Added an attribution based on the original SSLeay license for OpenSSL.
[wpasupplicant] / wpa_supplicant / wpa_cli.c
index bbe67f0..46ec736 100644 (file)
@@ -1152,6 +1152,7 @@ static int wpa_cli_exec(const char *program, const char *arg1,
        char *cmd;
        size_t len;
        int res;
+       int ret = 0;
 
        len = os_strlen(program) + os_strlen(arg1) + os_strlen(arg2) + 3;
        cmd = os_malloc(len);
@@ -1164,11 +1165,12 @@ static int wpa_cli_exec(const char *program, const char *arg1,
        }
        cmd[len - 1] = '\0';
 #ifndef _WIN32_WCE
-       system(cmd);
+       if (system(cmd) < 0)
+               ret = -1;
 #endif /* _WIN32_WCE */
        os_free(cmd);
 
-       return 0;
+       return ret;
 }