diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-06-18 07:11:52 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-06-18 07:11:52 +0000 |
commit | 9f54e730a1670e3f02df5738858fa4198caee4e1 (patch) | |
tree | de1ad360c012484101dcf8ec1ca18d8b75324404 | |
parent | b543a9844677910a79a8333dbbecd78d4e39d7b5 (diff) | |
parent | 619693476ec7b9dcbfbf197737f1b1638d1cd199 (diff) | |
download | android_frameworks_opt_net_wifi-9f54e730a1670e3f02df5738858fa4198caee4e1.tar.gz android_frameworks_opt_net_wifi-9f54e730a1670e3f02df5738858fa4198caee4e1.tar.bz2 android_frameworks_opt_net_wifi-9f54e730a1670e3f02df5738858fa4198caee4e1.zip |
release-request-f4ecf242-5d1c-45e0-8c7c-ede48d1a9e82-for-git_oc-release-4111650 snap-temp-L02200000075283731
Change-Id: I9db7d16df42900099887c3819f634add3f874819
-rw-r--r-- | libwifi_system/supplicant_manager.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/libwifi_system/supplicant_manager.cpp b/libwifi_system/supplicant_manager.cpp index d115dc1e7..28010ec8d 100644 --- a/libwifi_system/supplicant_manager.cpp +++ b/libwifi_system/supplicant_manager.cpp @@ -67,16 +67,22 @@ int ensure_config_file_exists(const char* config_file) { return false; } - templatePath = std::string("/system") + std::string(kSupplicantConfigTemplatePath); - srcfd = TEMP_FAILURE_RETRY(open(templatePath.c_str(), O_RDONLY)); + std::string configPathSystem = + std::string("/system") + std::string(kSupplicantConfigTemplatePath); + std::string configPathVendor = + std::string("/vendor") + std::string(kSupplicantConfigTemplatePath); + srcfd = TEMP_FAILURE_RETRY(open(configPathSystem.c_str(), O_RDONLY)); + templatePath = configPathSystem; if (srcfd < 0) { - LOG(ERROR) << "Cannot open \"" << templatePath << "\": " - << strerror(errno); - templatePath = std::string("/vendor") + std::string(kSupplicantConfigTemplatePath); - srcfd = TEMP_FAILURE_RETRY(open(templatePath.c_str(), O_RDONLY)); + int errnoSystem = errno; + srcfd = TEMP_FAILURE_RETRY(open(configPathVendor.c_str(), O_RDONLY)); + templatePath = configPathVendor; if (srcfd < 0) { - LOG(ERROR) << "Cannot open \"" << templatePath << "\": " - << strerror(errno); + int errnoVendor = errno; + LOG(ERROR) << "Cannot open \"" << configPathSystem << "\": " + << strerror(errnoSystem); + LOG(ERROR) << "Cannot open \"" << configPathVendor << "\": " + << strerror(errnoVendor); return false; } } |