Clean up: Replace standard lib methods with os.h ones
Some of the standard lib functions being used directly are redefined in src/utils/os.h thus providing an abstraction. Change code to use os_* functions instead of directly using the lib functions. Signed-hostap: Nirav Shah <nirav.j2.shah@intel.com> Signed-hostap: Angie Chinchilla <angie.v.chinchilla@intel.com>
This commit is contained in:
parent
4f68895e92
commit
024d018b55
5 changed files with 12 additions and 12 deletions
|
@ -1104,5 +1104,5 @@ void wpa_dbus_dict_entry_clear(struct wpa_dbus_dict_entry *entry)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(entry, 0, sizeof(struct wpa_dbus_dict_entry));
|
os_memset(entry, 0, sizeof(struct wpa_dbus_dict_entry));
|
||||||
}
|
}
|
||||||
|
|
|
@ -953,7 +953,7 @@ static int wpas_dbus_get_group_obj_path(struct wpa_supplicant *wpa_s,
|
||||||
if (os_memcmp(ssid->ssid, P2P_WILDCARD_SSID, P2P_WILDCARD_SSID_LEN))
|
if (os_memcmp(ssid->ssid, P2P_WILDCARD_SSID, P2P_WILDCARD_SSID_LEN))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
memcpy(group_name, ssid->ssid + P2P_WILDCARD_SSID_LEN, 2);
|
os_memcpy(group_name, ssid->ssid + P2P_WILDCARD_SSID_LEN, 2);
|
||||||
group_name[2] = '\0';
|
group_name[2] = '\0';
|
||||||
|
|
||||||
os_snprintf(group_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
|
os_snprintf(group_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
|
||||||
|
|
|
@ -253,7 +253,7 @@ dbus_bool_t set_network_properties(struct wpa_supplicant *wpa_s,
|
||||||
|
|
||||||
if ((os_strcmp(entry.key, "psk") == 0 &&
|
if ((os_strcmp(entry.key, "psk") == 0 &&
|
||||||
value[0] == '"' && ssid->ssid_len) ||
|
value[0] == '"' && ssid->ssid_len) ||
|
||||||
(strcmp(entry.key, "ssid") == 0 && ssid->passphrase))
|
(os_strcmp(entry.key, "ssid") == 0 && ssid->passphrase))
|
||||||
wpa_config_update_psk(ssid);
|
wpa_config_update_psk(ssid);
|
||||||
else if (os_strcmp(entry.key, "priority") == 0)
|
else if (os_strcmp(entry.key, "priority") == 0)
|
||||||
wpa_config_update_prio_list(wpa_s->conf);
|
wpa_config_update_prio_list(wpa_s->conf);
|
||||||
|
@ -547,25 +547,25 @@ DBusMessage * wpas_dbus_handler_create_interface(DBusMessage *message,
|
||||||
while (wpa_dbus_dict_has_dict_entry(&iter_dict)) {
|
while (wpa_dbus_dict_has_dict_entry(&iter_dict)) {
|
||||||
if (!wpa_dbus_dict_get_entry(&iter_dict, &entry))
|
if (!wpa_dbus_dict_get_entry(&iter_dict, &entry))
|
||||||
goto error;
|
goto error;
|
||||||
if (!strcmp(entry.key, "Driver") &&
|
if (!os_strcmp(entry.key, "Driver") &&
|
||||||
(entry.type == DBUS_TYPE_STRING)) {
|
(entry.type == DBUS_TYPE_STRING)) {
|
||||||
driver = os_strdup(entry.str_value);
|
driver = os_strdup(entry.str_value);
|
||||||
wpa_dbus_dict_entry_clear(&entry);
|
wpa_dbus_dict_entry_clear(&entry);
|
||||||
if (driver == NULL)
|
if (driver == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
} else if (!strcmp(entry.key, "Ifname") &&
|
} else if (!os_strcmp(entry.key, "Ifname") &&
|
||||||
(entry.type == DBUS_TYPE_STRING)) {
|
(entry.type == DBUS_TYPE_STRING)) {
|
||||||
ifname = os_strdup(entry.str_value);
|
ifname = os_strdup(entry.str_value);
|
||||||
wpa_dbus_dict_entry_clear(&entry);
|
wpa_dbus_dict_entry_clear(&entry);
|
||||||
if (ifname == NULL)
|
if (ifname == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
} else if (!strcmp(entry.key, "ConfigFile") &&
|
} else if (!os_strcmp(entry.key, "ConfigFile") &&
|
||||||
(entry.type == DBUS_TYPE_STRING)) {
|
(entry.type == DBUS_TYPE_STRING)) {
|
||||||
confname = os_strdup(entry.str_value);
|
confname = os_strdup(entry.str_value);
|
||||||
wpa_dbus_dict_entry_clear(&entry);
|
wpa_dbus_dict_entry_clear(&entry);
|
||||||
if (confname == NULL)
|
if (confname == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
} else if (!strcmp(entry.key, "BridgeIfname") &&
|
} else if (!os_strcmp(entry.key, "BridgeIfname") &&
|
||||||
(entry.type == DBUS_TYPE_STRING)) {
|
(entry.type == DBUS_TYPE_STRING)) {
|
||||||
bridge_ifname = os_strdup(entry.str_value);
|
bridge_ifname = os_strdup(entry.str_value);
|
||||||
wpa_dbus_dict_entry_clear(&entry);
|
wpa_dbus_dict_entry_clear(&entry);
|
||||||
|
|
|
@ -45,7 +45,7 @@ static int parse_peer_object_path(char *peer_path, u8 addr[ETH_ALEN])
|
||||||
|
|
||||||
if (!peer_path)
|
if (!peer_path)
|
||||||
return -1;
|
return -1;
|
||||||
p = strrchr(peer_path, '/');
|
p = os_strrchr(peer_path, '/');
|
||||||
if (!p)
|
if (!p)
|
||||||
return -1;
|
return -1;
|
||||||
p++;
|
p++;
|
||||||
|
|
|
@ -1880,7 +1880,7 @@ static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, char *cmd,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
len = sizeof(buf) - 1;
|
len = sizeof(buf) - 1;
|
||||||
ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), buf, &len,
|
ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len,
|
||||||
wpa_cli_msg_cb);
|
wpa_cli_msg_cb);
|
||||||
if (ret == -2) {
|
if (ret == -2) {
|
||||||
printf("'%s' command timed out.\n", cmd);
|
printf("'%s' command timed out.\n", cmd);
|
||||||
|
@ -1891,7 +1891,7 @@ static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, char *cmd,
|
||||||
}
|
}
|
||||||
|
|
||||||
buf[len] = '\0';
|
buf[len] = '\0';
|
||||||
if (memcmp(buf, "FAIL", 4) == 0)
|
if (os_memcmp(buf, "FAIL", 4) == 0)
|
||||||
return -1;
|
return -1;
|
||||||
printf("%s", buf);
|
printf("%s", buf);
|
||||||
|
|
||||||
|
@ -2425,7 +2425,7 @@ static int wpa_ctrl_command_p2p_peer(struct wpa_ctrl *ctrl, char *cmd,
|
||||||
if (ctrl_conn == NULL)
|
if (ctrl_conn == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
len = sizeof(buf) - 1;
|
len = sizeof(buf) - 1;
|
||||||
ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), buf, &len,
|
ret = wpa_ctrl_request(ctrl, cmd, os_strlen(cmd), buf, &len,
|
||||||
wpa_cli_msg_cb);
|
wpa_cli_msg_cb);
|
||||||
if (ret == -2) {
|
if (ret == -2) {
|
||||||
printf("'%s' command timed out.\n", cmd);
|
printf("'%s' command timed out.\n", cmd);
|
||||||
|
@ -2436,7 +2436,7 @@ static int wpa_ctrl_command_p2p_peer(struct wpa_ctrl *ctrl, char *cmd,
|
||||||
}
|
}
|
||||||
|
|
||||||
buf[len] = '\0';
|
buf[len] = '\0';
|
||||||
if (memcmp(buf, "FAIL", 4) == 0)
|
if (os_memcmp(buf, "FAIL", 4) == 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
pos = buf;
|
pos = buf;
|
||||||
|
|
Loading…
Reference in a new issue