client: Fix typos for Android

This commit is contained in:
Rom Walton 2013-02-08 18:46:03 -05:00 committed by Oliver Bock
parent d2df80a859
commit 64ec0f49a3
1 changed files with 7 additions and 10 deletions

View File

@ -64,19 +64,16 @@
//
bool HOST_INFO::host_wifi_online() {
char wifipath_pri[1024];
snprintf(wifipath_pri, sizeof(wifipath_pri),
char wifipath_sec[1024];
snprintf(wifipath_sec, sizeof(wifipath_sec),
FILE *f = fopen("/sys/class/net/eth0/operstate", "r");
// location in Android 2.3
if (!fsyswifi) {
fsyswifi = fopen("/sys/class/net/wlan0/operstate", "r");
// location in Android 4
}
char wifi_state[64];
// location in Android 2.3
FILE *f = fopen("/sys/class/net/eth0/operstate", "r");
if (!f) {
// location in Android 4
f = fopen("/sys/class/net/wlan0/operstate", "r");
}
if (f) {
fgets(wifi_state, 64, f);
fclose(f);