macloader: Use a variable for device type.

Change-Id: Ice29862ad6aaa15b07d6341893b0b8f1c65152e6
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
tirimbino
Andreas Schneider 10 years ago committed by Ethan Chen
parent 3a73bd3f2e
commit c7212d0365
  1. 37
      macloader/macloader.c

@ -120,6 +120,7 @@ int main() {
} }
if (type != NONE) { if (type != NONE) {
const char *type_str;
struct passwd *pwd; struct passwd *pwd;
int fd; int fd;
@ -134,37 +135,29 @@ int main() {
switch(type) { switch(type) {
case NONE: case NONE:
return -1; return -1;
break;
case MURATA: case MURATA:
/* write murata to cid file */ type_str = "murata";
ALOGI("Writing murata to %s\n", CID_PATH); break;
ret = fputs("murata", cidfile);
break;
case SEMCOSH: case SEMCOSH:
/* write semcosh to cid file */ type_str = "semcosh";
ALOGI("Writing semcosh to %s\n", CID_PATH); break;
ret = fputs("semcosh", cidfile);
break;
case SEMCOVE: case SEMCOVE:
/* write semcove to cid file */ type_str = "semcove";
ALOGI("Writing semcove to %s\n", CID_PATH); break;
ret = fputs("semcove", cidfile);
break;
case SEMCO3RD: case SEMCO3RD:
ALOGI("Writing semco3rd to %s\n", CID_PATH); type_str = "semco3rd";
ret = fputs("semco3rd", cidfile);
break; break;
case SEMCO: case SEMCO:
/* write semco to cid file */ type_str = "semco";
ALOGI("Writing semco to %s\n", CID_PATH); break;
ret = fputs("semco", cidfile);
break;
case WISOL: case WISOL:
ALOGI("Writing wisol to %s\n", CID_PATH); type_str = "wisol";
ret = fputs("wisol", cidfile);
break; break;
} }
ALOGI("Settting wifi type to %s in %s\n", type_str, CID_PATH);
ret = fputs(type_str, cidfile);
if (ret != 0) { if (ret != 0) {
fprintf(stderr, "fputs() to file %s failed\n", CID_PATH); fprintf(stderr, "fputs() to file %s failed\n", CID_PATH);
ALOGE("Can't write to %s\n", CID_PATH); ALOGE("Can't write to %s\n", CID_PATH);

Loading…
Cancel
Save