Skip to content

Commit

Permalink
wifi: fix compile error that... I didn't have earlier...
Browse files Browse the repository at this point in the history
  • Loading branch information
Daz Jones committed Jan 25, 2013
1 parent 45460ad commit ae0e83f
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions libhardware_legacy/wifi/wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,29 @@ int wifi_send_command(int index, const char *cmd, char *reply, size_t *reply_len
return 0;
}

void wifi_close_sockets(int index)
{
if (ctrl_conn[index] != NULL) {
wpa_ctrl_close(ctrl_conn[index]);
ctrl_conn[index] = NULL;
}

if (monitor_conn[index] != NULL) {
wpa_ctrl_close(monitor_conn[index]);
monitor_conn[index] = NULL;
}

if (exit_sockets[index][0] >= 0) {
close(exit_sockets[index][0]);
exit_sockets[index][0] = -1;
}

if (exit_sockets[index][1] >= 0) {
close(exit_sockets[index][1]);
exit_sockets[index][1] = -1;
}
}

int wifi_ctrl_recv(int index, char *reply, size_t *reply_len)
{
int res;
Expand Down Expand Up @@ -1124,29 +1147,6 @@ int wifi_wait_for_event(const char *ifname, char *buf, size_t buflen)
}
}

void wifi_close_sockets(int index)
{
if (ctrl_conn[index] != NULL) {
wpa_ctrl_close(ctrl_conn[index]);
ctrl_conn[index] = NULL;
}

if (monitor_conn[index] != NULL) {
wpa_ctrl_close(monitor_conn[index]);
monitor_conn[index] = NULL;
}

if (exit_sockets[index][0] >= 0) {
close(exit_sockets[index][0]);
exit_sockets[index][0] = -1;
}

if (exit_sockets[index][1] >= 0) {
close(exit_sockets[index][1]);
exit_sockets[index][1] = -1;
}
}

void wifi_close_supplicant_connection(const char *ifname)
{
char supp_status[PROPERTY_VALUE_MAX] = {'\0'};
Expand Down

0 comments on commit ae0e83f

Please sign in to comment.