int ioctl_sock = 0;
int pm_state = 0;
wifi_service_state_e wifi_state;
+ char error_buf[MAX_SIZE_ERROR_BUFFER] = {0, };
if (old_state == value) {
DBG("Old and new states are same");
ioctl_sock = socket(PF_INET, SOCK_DGRAM, 0);
if (ioctl_sock < 0) {
- DBG("socket(PF_INET,SOCK_DGRAM) failed");
+ strerror_r(errno, error_buf, MAX_SIZE_ERROR_BUFFER);
+ DBG("socket(PF_INET,SOCK_DGRAM) failed: %s", error_buf);
return;
}
ret = ioctl(ioctl_sock, WLAN_IOCTL_SUSPEND, &ifr);
- if (ret < 0)
- ERR("Fail to issue private commands: %d. %s", ret, strerror(errno));
- else {
+ if (ret < 0) {
+ strerror_r(errno, error_buf, MAX_SIZE_ERROR_BUFFER);
+ ERR("Fail to issue private commands: %d. %s", ret, error_buf);
+ } else {
old_state = value;
}