]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Show more helpful message for -g and -G errors
authorJouni Malinen <j@w1.fi>
Mon, 1 Apr 2013 15:17:24 +0000 (18:17 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 1 Apr 2013 15:17:24 +0000 (18:17 +0300)
Signed-hostap: Jouni Malinen <j@w1.fi>

hostapd/main.c

index 881a053e9177d4202a9cb6e8619d2c22ff08dfd3..d2ec1a502abe4d6d5eb2bf69845687c0bd501443 100644 (file)
@@ -525,6 +525,8 @@ static int hostapd_get_global_ctrl_iface(struct hapd_interfaces *interfaces,
                return -1;
        pos = os_strrchr(interfaces->global_iface_path, '/');
        if (pos == NULL) {
+               wpa_printf(MSG_ERROR, "No '/' in the global control interface "
+                          "file");
                os_free(interfaces->global_iface_path);
                interfaces->global_iface_path = NULL;
                return -1;
@@ -614,10 +616,12 @@ int main(int argc, char *argv[])
                        exit(1);
                        break;
                case 'g':
-                       hostapd_get_global_ctrl_iface(&interfaces, optarg);
+                       if (hostapd_get_global_ctrl_iface(&interfaces, optarg))
+                               return -1;
                        break;
                case 'G':
-                       hostapd_get_ctrl_iface_group(&interfaces, optarg);
+                       if (hostapd_get_ctrl_iface_group(&interfaces, optarg))
+                               return -1;
                        break;
                default:
                        usage();