Use more os.h wrapper functions in hostapd_cli
This commit is contained in:
parent
bae9217474
commit
b242d398f8
1 changed files with 7 additions and 6 deletions
|
@ -791,8 +791,8 @@ int main(int argc, char *argv[])
|
||||||
printf("%s\n", hostapd_cli_version);
|
printf("%s\n", hostapd_cli_version);
|
||||||
return 0;
|
return 0;
|
||||||
case 'i':
|
case 'i':
|
||||||
free(ctrl_ifname);
|
os_free(ctrl_ifname);
|
||||||
ctrl_ifname = strdup(optarg);
|
ctrl_ifname = os_strdup(optarg);
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
ctrl_iface_dir = optarg;
|
ctrl_iface_dir = optarg;
|
||||||
|
@ -816,12 +816,13 @@ int main(int argc, char *argv[])
|
||||||
DIR *dir = opendir(ctrl_iface_dir);
|
DIR *dir = opendir(ctrl_iface_dir);
|
||||||
if (dir) {
|
if (dir) {
|
||||||
while ((dent = readdir(dir))) {
|
while ((dent = readdir(dir))) {
|
||||||
if (strcmp(dent->d_name, ".") == 0 ||
|
if (os_strcmp(dent->d_name, ".") == 0
|
||||||
strcmp(dent->d_name, "..") == 0)
|
||
|
||||||
|
os_strcmp(dent->d_name, "..") == 0)
|
||||||
continue;
|
continue;
|
||||||
printf("Selected interface '%s'\n",
|
printf("Selected interface '%s'\n",
|
||||||
dent->d_name);
|
dent->d_name);
|
||||||
ctrl_ifname = strdup(dent->d_name);
|
ctrl_ifname = os_strdup(dent->d_name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
|
@ -844,7 +845,7 @@ int main(int argc, char *argv[])
|
||||||
printf("Could not connect to hostapd - re-trying\n");
|
printf("Could not connect to hostapd - re-trying\n");
|
||||||
warning_displayed = 1;
|
warning_displayed = 1;
|
||||||
}
|
}
|
||||||
sleep(1);
|
os_sleep(1, 0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue