about summary refs log tree commit diff stats
path: root/src/handlers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/handlers.c')
-rw-r--r--src/handlers.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/handlers.c b/src/handlers.c
index 9aea176..7c2b768 100644
--- a/src/handlers.c
+++ b/src/handlers.c
@@ -93,9 +93,17 @@ void *read_req_resp(void *args) {
 		return nbd_nbtpd_resp_error(args);
 	}
 	memset(buf, '\0', 512);
-
+	int s = socket(AF_INET, SOCK_DGRAM, 0);
+	if (s <= 0) {
+		syslog(LOG_ERR, "unable to define socket!");
+		fclose(fp);
+		free(buf);
+		free(args);
+		return (void *)NULL;
+	}
+	
 	//TODO: make new socket and go into main loop
-
+	fclose(fp);
 	free(buf);
 	free(args);
 	return (void *)NULL;