loop device code: readability improvement

This commit is contained in:
Denis Vlasenko
2007-04-19 00:09:34 +00:00
parent 3ace9fa6d8
commit c34d35557b
2 changed files with 20 additions and 13 deletions

View File

@ -45,9 +45,11 @@ int losetup_main(int argc, char **argv)
bb_perror_nomsg_and_die();
} else if (argc == 1) {
char *s = query_loop(argv[0]);
if (!s) bb_perror_nomsg_and_die();
if (!s)
bb_perror_nomsg_and_die();
printf("%s: %s\n", argv[0], s);
if (ENABLE_FEATURE_CLEAN_UP) free(s);
if (ENABLE_FEATURE_CLEAN_UP)
free(s);
} else {
char dev[sizeof(LOOP_NAME"0")] = LOOP_NAME"0";
char c;
@ -57,7 +59,8 @@ int losetup_main(int argc, char **argv)
s = query_loop(dev);
if (s) {
printf("%s: %s\n", dev, s);
if (ENABLE_FEATURE_CLEAN_UP) free(s);
if (ENABLE_FEATURE_CLEAN_UP)
free(s);
}
}
}