summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2015-01-26 22:45:26 +0100
committerAndreas Schneider <asn@cryptomilk.org>2015-01-27 09:06:16 +0100
commit8a4859ebab5affe46a51bdab078b495d9eda7814 (patch)
tree7a77142bd7a808b249e5a4fbb70171f96e6a6590
parent32eb7b39fe78db39fcbcfa10890163661189dfd4 (diff)
downloadandroid_hardware_samsung-8a4859ebab5affe46a51bdab078b495d9eda7814.tar.gz
android_hardware_samsung-8a4859ebab5affe46a51bdab078b495d9eda7814.tar.bz2
android_hardware_samsung-8a4859ebab5affe46a51bdab078b495d9eda7814.zip
macloader: Use a variable for device type.
Change-Id: Ice29862ad6aaa15b07d6341893b0b8f1c65152e6 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--macloader/macloader.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/macloader/macloader.c b/macloader/macloader.c
index c7aa713..7f65fef 100644
--- a/macloader/macloader.c
+++ b/macloader/macloader.c
@@ -108,6 +108,7 @@ int main() {
}
if (type != NONE) {
+ const char *type_str;
struct passwd *pwd;
int fd;
@@ -122,32 +123,26 @@ int main() {
switch(type) {
case NONE:
return -1;
- break;
case MURATA:
- /* write murata to cid file */
- ALOGI("Writing murata to %s\n", CID_PATH);
- ret = fputs("murata", cidfile);
- break;
+ type_str = "murata";
+ break;
case SEMCOSH:
- /* write semcosh to cid file */
- ALOGI("Writing semcosh to %s\n", CID_PATH);
- ret = fputs("semcosh", cidfile);
- break;
+ type_str = "semcosh";
+ break;
case SEMCOVE:
- /* write semcove to cid file */
- ALOGI("Writing semcove to %s\n", CID_PATH);
- ret = fputs("semcove", cidfile);
- break;
+ type_str = "semcove";
+ break;
case SEMCO3RD:
- ALOGI("Writing semco3rd to %s\n", CID_PATH);
- ret = fputs("semco3rd", cidfile);
- break;
+ type_str = "semco3rd";
+ break;
case WISOL:
- ALOGI("Writing wisol to %s\n", CID_PATH);
- ret = fputs("wisol", cidfile);
- break;
- }
+ type_str = "wisol";
+ break;
+ }
+
+ ALOGI("Settting wifi type to %s in %s\n", type_str, CID_PATH);
+ ret = fputs(type_str, cidfile);
if (ret != 0) {
fprintf(stderr, "fputs() to file %s failed\n", CID_PATH);
ALOGE("Can't write to %s\n", CID_PATH);