exit: fix some exit codes
authorFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 30 Nov 2015 12:51:12 +0000 (13:51 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 30 Nov 2015 13:04:48 +0000 (14:04 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/olsr_switch/main.c

index fed20de..610a3ad 100644 (file)
@@ -286,13 +286,13 @@ ohs_init_connect_sockets(void)
 
   if ((srv_socket = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
     printf("Could not initialize socket(%d): %s\n", srv_socket, strerror(errno));
-    exit(EXIT_SUCCESS);
+    exit(EXIT_FAILURE);
   }
 
   if (setsockopt(srv_socket, SOL_SOCKET, SO_REUSEADDR, (char *)&yes, sizeof(yes)) < 0) {
     printf("SO_REUSEADDR failed for socket: %s\n", strerror(errno));
     close(srv_socket);
-    exit(EXIT_SUCCESS);
+    exit(EXIT_FAILURE);
   }
 
   /* complete the socket structure */
@@ -305,14 +305,14 @@ ohs_init_connect_sockets(void)
   if (bind(srv_socket, (struct sockaddr *)&sin, sizeof(sin)) == -1) {
     printf("bind failed for socket: %s\n", strerror(errno));
     close(srv_socket);
-    exit(EXIT_SUCCESS);
+    exit(EXIT_FAILURE);
   }
 
   /* show that we are willing to listen */
   if (listen(srv_socket, 5) == -1) {
     printf("listen failed for socket: %s\n", strerror(errno));
     close(srv_socket);
-    exit(EXIT_SUCCESS);
+    exit(EXIT_FAILURE);
   }
   return 1;
 }