check-net: remove redundant exit()
authorMunkyu Im <munkyu.im@samsung.com>
Wed, 24 Jun 2015 02:00:33 +0000 (11:00 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Wed, 24 Jun 2015 05:33:06 +0000 (14:33 +0900)
replace these with return.

Change-Id: I75edda56bdc3f715a6fa3bb786788e84075b671f
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
tizen/src/util/check_net.c
tizen/src/util/check_net_darwin.c
tizen/src/util/check_net_linux.c
tizen/src/util/check_net_win32.c

index 8a784fb..aae1a18 100644 (file)
@@ -93,7 +93,7 @@ void main(int argc, char *argv[])
         fprintf(stderr, "        check-net --interface-all\n");
         fprintf(stderr, "        check-net --bridge\n");
         fprintf(stderr, "        check-net --host-ip\n");
-        exit(1);
+        return;
     }
     if (strcmp(argv[1], ARG_PROXY) == 0) {
         get_host_proxy_os();
index 70c1c79..0a00719 100644 (file)
@@ -202,7 +202,6 @@ void get_host_interface_all_os(void)
         system("/sbin/ifconfig -a");
     } else {
         fprintf(stderr, "ifconfig does not exist!\n");
-        exit(1);
     }
 }
 
@@ -212,7 +211,6 @@ void get_host_bridge_os(void)
         system("/sbin/ifconfig bridge1");
     } else {
         fprintf(stderr, "ifconfig does not exist!\n");
-        exit(1);
     }
 }
 
@@ -232,6 +230,4 @@ void get_host_ip_os(void)
     }
 
     freeifaddrs(ifap);
-
-    exit(0);
 }
index 9bb48a8..c2100d8 100644 (file)
@@ -246,7 +246,6 @@ void get_host_interface_all_os(void)
         system("/sbin/ifconfig -a");
     } else {
         fprintf(stderr, "ifconfig does not exist!\n");
-        exit(1);
     }
 }
 
@@ -256,7 +255,6 @@ void get_host_bridge_os(void)
         system("/sbin/ifconfig bridge1");
     } else {
         fprintf(stderr, "ifconfig does not exist!\n");
-        exit(1);
     }
 }
 
@@ -276,6 +274,4 @@ void get_host_ip_os(void)
     }
 
     freeifaddrs(ifap);
-
-    exit(0);
 }
index 8a702cd..9117ae4 100644 (file)
@@ -283,7 +283,7 @@ static void get_host_interface(int value)
         pAddresses = (IP_ADAPTER_ADDRESSES *) MALLOC(outBufLen);
         if (pAddresses == NULL) {
             fprintf(stderr, "Memory allocation failed for IP_ADAPTER_ADDRESSES struct\n");
-            exit(1);
+            return;
         }
 
         dwRetAddressVal = GetAdaptersAddresses(AF_INET, flags, NULL, pAddresses, &outBufLen);
@@ -304,14 +304,14 @@ static void get_host_interface(int value)
     pAdapterInfo = (IP_ADAPTER_INFO *) MALLOC(sizeof (IP_ADAPTER_INFO));
     if (pAdapterInfo == NULL) {
         fprintf(stderr, "Error allocating memory needed to call GetAdaptersinfo\n");
-        exit(1);
+        return;
     }
     if (GetAdaptersInfo(pAdapterInfo, &ulOutBufLen) == ERROR_BUFFER_OVERFLOW) {
         FREE(pAdapterInfo);
         pAdapterInfo = (IP_ADAPTER_INFO *) MALLOC(ulOutBufLen);
         if (pAdapterInfo == NULL) {
             fprintf(stderr, "Error allocating memory needed to call GetAdaptersinfo\n");
-            exit(1);
+            return;
         }
     }
     dwRetVal = GetAdaptersInfo(pAdapterInfo, &ulOutBufLen);
@@ -334,12 +334,10 @@ static void get_host_interface(int value)
         }
     } else {
         fprintf(stderr, "GetAdaptersInfo failed with error: %d\n", dwRetVal);
-        exit(1);
+        return;
     }
     if (pAdapterInfo)
         FREE(pAdapterInfo);
-
-    exit(0);
 }
 
 void get_host_interface_all_os(void)