Add a file path to check mac address #2 77/107377/1
authortaesub kim <taesub.kim@samsung.com>
Tue, 27 Dec 2016 23:40:28 +0000 (08:40 +0900)
committertaesub kim <taesub.kim@samsung.com>
Tue, 27 Dec 2016 23:40:47 +0000 (08:40 +0900)
Change-Id: Ifea793e5bc2433e973de4e4dbc31bfca87b2ace6
Signed-off-by: Taesub Kim <taesub.kim@samsung.com>
src/wifi-power.c

index 2ef365e..be2dacd 100755 (executable)
@@ -58,6 +58,7 @@
 #endif
 
 #define WLAN_MAC_INFO              tzplatform_mkpath(TZ_SYS_ETC, "/.mac.info")
+#define WLAN_MAC_ADDRESS_FILEPATH   "/sys/class/net/wlan0/address"
 #define WLAN_MAC_ADDR_MAX          20
 #define VCONF_WIFI_BSSID_ADDRESS       "db/wifi/bssid_address"
 
@@ -322,8 +323,12 @@ static void __netconfig_set_wifi_bssid(void)
        FILE *fp = fopen(WLAN_MAC_INFO, "r");
 
        if (fp == NULL) {
-               ERR("Fail to open file");
-               return;
+               ERR("Fail to open %s", WLAN_MAC_INFO);
+               fp = fopen(WLAN_MAC_ADDRESS_FILEPATH, "r");
+               if (fp == NULL) {
+                       ERR("Fail to open %s", WLAN_MAC_ADDRESS_FILEPATH);
+                       return;
+               }
        }
 
        fseek(fp, 0L, SEEK_SET);