Fix: SIGPIPE issue while querying softap enabled status
Before downloading commands to driver through softap SDK we are checking if SoftAP is enabled are not by running ps in popen. This sometime throws SIGPIPE error (signal) which is not handled, due to this we were facing application crash. To fix this we modify to check the operation mode of the driver through ioctl. Change-Id: Ia0703ff343d401801655d3b666ade66107a4789e CRs-Fixed: 535340
This commit is contained in:
committed by
Gerrit Code Review
parent
fe07ff9ee2
commit
52fd77178b
@@ -434,26 +434,22 @@ s32 wifi_qsap_stop_bss(void)
|
||||
|
||||
s32 is_softap_enabled(void)
|
||||
{
|
||||
FILE *fp;
|
||||
char buf[1024];
|
||||
s32 mode = 0;
|
||||
int ret;
|
||||
|
||||
fp = popen("ps", "r");
|
||||
if (fp == NULL) {
|
||||
ALOGE("Failed to open file");
|
||||
ret = qsap_get_mode(&mode);
|
||||
if (eSUCCESS != ret) {
|
||||
ALOGD("Failed to get the mode of operation\n");
|
||||
return eERR_UNKNOWN;
|
||||
}
|
||||
|
||||
while (fgets(buf, sizeof(buf)-1, fp) != NULL) {
|
||||
if(NULL !=(strstr(buf,"hostapd")))
|
||||
{
|
||||
pclose(fp);
|
||||
ALOGD("HOSTAPD enabled\n");
|
||||
return ENABLE;
|
||||
}
|
||||
if (mode == IW_MODE_MASTER) {
|
||||
ALOGD("HOSTAPD Enabled\n");
|
||||
return ENABLE;
|
||||
}
|
||||
|
||||
ALOGD("HOSTAPD disabled\n");
|
||||
pclose(fp);
|
||||
ALOGD("HOSTAPD Disabled\n");
|
||||
|
||||
return DISABLE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user