diff options
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/dmesg.c | 8 | ||||
-rw-r--r-- | util-linux/fbset.c | 16 | ||||
-rw-r--r-- | util-linux/fdflush.c | 12 | ||||
-rw-r--r-- | util-linux/fdisk.c | 10 | ||||
-rw-r--r-- | util-linux/freeramdisk.c | 6 | ||||
-rw-r--r-- | util-linux/fsck_minix.c | 10 | ||||
-rw-r--r-- | util-linux/getopt.c | 22 | ||||
-rw-r--r-- | util-linux/hexdump.c | 149 | ||||
-rw-r--r-- | util-linux/hwclock.c | 18 | ||||
-rw-r--r-- | util-linux/losetup.c | 6 | ||||
-rw-r--r-- | util-linux/mkfs_minix.c | 62 | ||||
-rw-r--r-- | util-linux/mkswap.c | 46 | ||||
-rw-r--r-- | util-linux/more.c | 4 | ||||
-rw-r--r-- | util-linux/mount.c | 34 | ||||
-rw-r--r-- | util-linux/nfsmount.c | 30 | ||||
-rw-r--r-- | util-linux/pivot_root.c | 4 | ||||
-rw-r--r-- | util-linux/rdate.c | 8 | ||||
-rw-r--r-- | util-linux/swaponoff.c | 14 | ||||
-rw-r--r-- | util-linux/umount.c | 21 |
19 files changed, 226 insertions, 254 deletions
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c index aa8eb95c9..fb1639ace 100644 --- a/util-linux/dmesg.c +++ b/util-linux/dmesg.c | |||
@@ -42,7 +42,7 @@ int dmesg_main(int argc, char **argv) | |||
42 | int lastc; | 42 | int lastc; |
43 | int cmd = 3; | 43 | int cmd = 3; |
44 | 44 | ||
45 | while ((i = getopt(argc, argv, "cn:s:")) != EOF) { | 45 | while ((i = getopt(argc, argv, "cn:s:")) > 0) { |
46 | switch (i) { | 46 | switch (i) { |
47 | case 'c': | 47 | case 'c': |
48 | cmd = 4; | 48 | cmd = 4; |
@@ -58,12 +58,12 @@ int dmesg_main(int argc, char **argv) | |||
58 | bufsize = bb_xgetlarg(optarg, 10, 4096, 512*1024); | 58 | bufsize = bb_xgetlarg(optarg, 10, 4096, 512*1024); |
59 | break; | 59 | break; |
60 | default: | 60 | default: |
61 | show_usage(); | 61 | bb_show_usage(); |
62 | } | 62 | } |
63 | } | 63 | } |
64 | 64 | ||
65 | if (optind < argc) { | 65 | if (optind < argc) { |
66 | show_usage(); | 66 | bb_show_usage(); |
67 | } | 67 | } |
68 | 68 | ||
69 | if (cmd == 8) { | 69 | if (cmd == 8) { |
@@ -98,5 +98,5 @@ all_done: | |||
98 | #endif | 98 | #endif |
99 | return EXIT_SUCCESS; | 99 | return EXIT_SUCCESS; |
100 | die_the_death: | 100 | die_the_death: |
101 | perror_msg_and_die(NULL); | 101 | bb_perror_nomsg_and_die(); |
102 | } | 102 | } |
diff --git a/util-linux/fbset.c b/util-linux/fbset.c index 9423abc09..afd9e64be 100644 --- a/util-linux/fbset.c +++ b/util-linux/fbset.c | |||
@@ -194,7 +194,7 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn, | |||
194 | char buf[256]; | 194 | char buf[256]; |
195 | char *p = buf; | 195 | char *p = buf; |
196 | 196 | ||
197 | f = xfopen(fn, "r"); | 197 | f = bb_xfopen(fn, "r"); |
198 | while (!feof(f)) { | 198 | while (!feof(f)) { |
199 | fgets(buf, sizeof(buf), f); | 199 | fgets(buf, sizeof(buf), f); |
200 | if ((p = strstr(buf, "mode ")) || (p = strstr(buf, "mode\t"))) { | 200 | if ((p = strstr(buf, "mode ")) || (p = strstr(buf, "mode\t"))) { |
@@ -279,7 +279,7 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn, | |||
279 | } | 279 | } |
280 | } | 280 | } |
281 | #else | 281 | #else |
282 | error_msg( "mode reading not compiled in"); | 282 | bb_error_msg( "mode reading not compiled in"); |
283 | #endif | 283 | #endif |
284 | return 0; | 284 | return 0; |
285 | } | 285 | } |
@@ -350,7 +350,7 @@ extern int fbset_main(int argc, char **argv) | |||
350 | for (i = 0; g_cmdoptions[i].name; i++) { | 350 | for (i = 0; g_cmdoptions[i].name; i++) { |
351 | if (!strcmp(thisarg, g_cmdoptions[i].name)) { | 351 | if (!strcmp(thisarg, g_cmdoptions[i].name)) { |
352 | if (argc - 1 < g_cmdoptions[i].param_count) | 352 | if (argc - 1 < g_cmdoptions[i].param_count) |
353 | show_usage(); | 353 | bb_show_usage(); |
354 | switch (g_cmdoptions[i].code) { | 354 | switch (g_cmdoptions[i].code) { |
355 | case CMD_FB: | 355 | case CMD_FB: |
356 | fbdev = argv[1]; | 356 | fbdev = argv[1]; |
@@ -399,18 +399,18 @@ extern int fbset_main(int argc, char **argv) | |||
399 | mode = *argv; | 399 | mode = *argv; |
400 | g_options |= OPT_READMODE; | 400 | g_options |= OPT_READMODE; |
401 | } else { | 401 | } else { |
402 | show_usage(); | 402 | bb_show_usage(); |
403 | } | 403 | } |
404 | } | 404 | } |
405 | } | 405 | } |
406 | 406 | ||
407 | if ((fh = open(fbdev, O_RDONLY)) < 0) | 407 | if ((fh = open(fbdev, O_RDONLY)) < 0) |
408 | perror_msg_and_die("fbset(open)"); | 408 | bb_perror_msg_and_die("fbset(open)"); |
409 | if (ioctl(fh, FBIOGET_VSCREENINFO, &var)) | 409 | if (ioctl(fh, FBIOGET_VSCREENINFO, &var)) |
410 | perror_msg_and_die("fbset(ioctl)"); | 410 | bb_perror_msg_and_die("fbset(ioctl)"); |
411 | if (g_options & OPT_READMODE) { | 411 | if (g_options & OPT_READMODE) { |
412 | if (!readmode(&var, modefile, mode)) { | 412 | if (!readmode(&var, modefile, mode)) { |
413 | error_msg("Unknown video mode `%s'", mode); | 413 | bb_error_msg("Unknown video mode `%s'", mode); |
414 | return EXIT_FAILURE; | 414 | return EXIT_FAILURE; |
415 | } | 415 | } |
416 | } | 416 | } |
@@ -418,7 +418,7 @@ extern int fbset_main(int argc, char **argv) | |||
418 | setmode(&var, &varset); | 418 | setmode(&var, &varset); |
419 | if (g_options & OPT_CHANGE) | 419 | if (g_options & OPT_CHANGE) |
420 | if (ioctl(fh, FBIOPUT_VSCREENINFO, &var)) | 420 | if (ioctl(fh, FBIOPUT_VSCREENINFO, &var)) |
421 | perror_msg_and_die("fbset(ioctl)"); | 421 | bb_perror_msg_and_die("fbset(ioctl)"); |
422 | showmode(&var); | 422 | showmode(&var); |
423 | /* Don't close the file, as exiting will take care of that */ | 423 | /* Don't close the file, as exiting will take care of that */ |
424 | /* close(fh); */ | 424 | /* close(fh); */ |
diff --git a/util-linux/fdflush.c b/util-linux/fdflush.c index 0756ddfbf..c3fcf3325 100644 --- a/util-linux/fdflush.c +++ b/util-linux/fdflush.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <sys/ioctl.h> | 25 | #include <sys/ioctl.h> |
26 | #include <fcntl.h> | 26 | #include <fcntl.h> |
27 | #include <stdlib.h> | 27 | #include <stdlib.h> |
28 | #include <unistd.h> | ||
28 | #include "busybox.h" | 29 | #include "busybox.h" |
29 | 30 | ||
30 | /* From <linux/fd.h> */ | 31 | /* From <linux/fd.h> */ |
@@ -35,22 +36,19 @@ extern int fdflush_main(int argc, char **argv) | |||
35 | int fd, result; | 36 | int fd, result; |
36 | 37 | ||
37 | if (argc <= 1) | 38 | if (argc <= 1) |
38 | show_usage(); | 39 | bb_show_usage(); |
39 | if ((fd = open(*(++argv), 0)) < 0) | 40 | |
40 | goto die_the_death; | 41 | fd = bb_xopen(argv[1], 0); |
41 | 42 | ||
42 | result = ioctl(fd, FDFLUSH, 0); | 43 | result = ioctl(fd, FDFLUSH, 0); |
43 | #ifdef CONFIG_FEATURE_CLEAN_UP | 44 | #ifdef CONFIG_FEATURE_CLEAN_UP |
44 | close(fd); | 45 | close(fd); |
45 | #endif | 46 | #endif |
46 | if (result) { | 47 | if (result) { |
47 | goto die_the_death; | 48 | bb_perror_nomsg_and_die(); |
48 | } | 49 | } |
49 | 50 | ||
50 | /* Don't bother closing. Exit does | 51 | /* Don't bother closing. Exit does |
51 | * that, so we can save a few bytes */ | 52 | * that, so we can save a few bytes */ |
52 | return EXIT_SUCCESS; | 53 | return EXIT_SUCCESS; |
53 | |||
54 | die_the_death: | ||
55 | perror_msg_and_die(NULL); | ||
56 | } | 54 | } |
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index 696e64c7d..71fbe074e 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c | |||
@@ -5655,7 +5655,7 @@ tryprocpt(void) { | |||
5655 | char line[100], ptname[100], devname[120], *s; | 5655 | char line[100], ptname[100], devname[120], *s; |
5656 | int ma, mi, sz; | 5656 | int ma, mi, sz; |
5657 | 5657 | ||
5658 | procpt = wfopen(PROC_PARTITIONS, "r"); | 5658 | procpt = bb_wfopen(PROC_PARTITIONS, "r"); |
5659 | 5659 | ||
5660 | while (fgets(line, sizeof(line), procpt)) { | 5660 | while (fgets(line, sizeof(line), procpt)) { |
5661 | if (sscanf (line, " %d %d %d %[^\n ]", | 5661 | if (sscanf (line, " %d %d %d %[^\n ]", |
@@ -5711,7 +5711,7 @@ int fdisk_main(int argc, char **argv) { | |||
5711 | sector_size = atoi(optarg); | 5711 | sector_size = atoi(optarg); |
5712 | if (sector_size != 512 && sector_size != 1024 && | 5712 | if (sector_size != 512 && sector_size != 1024 && |
5713 | sector_size != 2048) | 5713 | sector_size != 2048) |
5714 | show_usage(); | 5714 | bb_show_usage(); |
5715 | sector_offset = 2; | 5715 | sector_offset = 2; |
5716 | user_set_sector_size = 1; | 5716 | user_set_sector_size = 1; |
5717 | break; | 5717 | break; |
@@ -5746,7 +5746,7 @@ int fdisk_main(int argc, char **argv) { | |||
5746 | printf("fdisk v" UTIL_LINUX_VERSION "\n"); | 5746 | printf("fdisk v" UTIL_LINUX_VERSION "\n"); |
5747 | return 0; | 5747 | return 0; |
5748 | default: | 5748 | default: |
5749 | show_usage(); | 5749 | bb_show_usage(); |
5750 | } | 5750 | } |
5751 | } | 5751 | } |
5752 | 5752 | ||
@@ -5794,7 +5794,7 @@ int fdisk_main(int argc, char **argv) { | |||
5794 | 5794 | ||
5795 | opts = argc - optind; | 5795 | opts = argc - optind; |
5796 | if (opts <= 0) | 5796 | if (opts <= 0) |
5797 | show_usage(); | 5797 | bb_show_usage(); |
5798 | 5798 | ||
5799 | for (j = optind; j < argc; j++) { | 5799 | for (j = optind; j < argc; j++) { |
5800 | disk_device = argv[j]; | 5800 | disk_device = argv[j]; |
@@ -5816,7 +5816,7 @@ int fdisk_main(int argc, char **argv) { | |||
5816 | if (argc-optind == 1) | 5816 | if (argc-optind == 1) |
5817 | disk_device = argv[optind]; | 5817 | disk_device = argv[optind]; |
5818 | else | 5818 | else |
5819 | show_usage(); | 5819 | bb_show_usage(); |
5820 | 5820 | ||
5821 | get_boot(fdisk); | 5821 | get_boot(fdisk); |
5822 | 5822 | ||
diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c index dd7700c06..9276a6c40 100644 --- a/util-linux/freeramdisk.c +++ b/util-linux/freeramdisk.c | |||
@@ -41,17 +41,17 @@ freeramdisk_main(int argc, char **argv) | |||
41 | FILE *f; | 41 | FILE *f; |
42 | 42 | ||
43 | if (argc != 2) { | 43 | if (argc != 2) { |
44 | show_usage(); | 44 | bb_show_usage(); |
45 | } | 45 | } |
46 | 46 | ||
47 | f = xfopen(argv[1], "r+"); | 47 | f = bb_xfopen(argv[1], "r+"); |
48 | 48 | ||
49 | result = ioctl(fileno(f), BLKFLSBUF); | 49 | result = ioctl(fileno(f), BLKFLSBUF); |
50 | #ifdef CONFIG_FEATURE_CLEAN_UP | 50 | #ifdef CONFIG_FEATURE_CLEAN_UP |
51 | fclose(f); | 51 | fclose(f); |
52 | #endif | 52 | #endif |
53 | if (result < 0) { | 53 | if (result < 0) { |
54 | perror_msg_and_die("failed ioctl on %s", argv[1]); | 54 | bb_perror_msg_and_die("failed ioctl on %s", argv[1]); |
55 | } | 55 | } |
56 | 56 | ||
57 | /* Don't bother closing. Exit does | 57 | /* Don't bother closing. Exit does |
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index d332b6b0a..3a691476e 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c | |||
@@ -279,7 +279,7 @@ static void leave(int status) | |||
279 | 279 | ||
280 | static void die(const char *str) | 280 | static void die(const char *str) |
281 | { | 281 | { |
282 | error_msg("%s", str); | 282 | bb_error_msg("%s", str); |
283 | leave(8); | 283 | leave(8); |
284 | } | 284 | } |
285 | 285 | ||
@@ -1344,7 +1344,7 @@ extern int fsck_minix_main(int argc, char **argv) | |||
1344 | argv++; | 1344 | argv++; |
1345 | if (argv[0][0] != '-') { | 1345 | if (argv[0][0] != '-') { |
1346 | if (device_name) | 1346 | if (device_name) |
1347 | show_usage(); | 1347 | bb_show_usage(); |
1348 | else | 1348 | else |
1349 | device_name = argv[0]; | 1349 | device_name = argv[0]; |
1350 | } else | 1350 | } else |
@@ -1374,11 +1374,11 @@ extern int fsck_minix_main(int argc, char **argv) | |||
1374 | force = 1; | 1374 | force = 1; |
1375 | break; | 1375 | break; |
1376 | default: | 1376 | default: |
1377 | show_usage(); | 1377 | bb_show_usage(); |
1378 | } | 1378 | } |
1379 | } | 1379 | } |
1380 | if (!device_name) | 1380 | if (!device_name) |
1381 | show_usage(); | 1381 | bb_show_usage(); |
1382 | check_mount(); /* trying to check a mounted filesystem? */ | 1382 | check_mount(); /* trying to check a mounted filesystem? */ |
1383 | if (repair && !automatic) { | 1383 | if (repair && !automatic) { |
1384 | if (!isatty(0) || !isatty(1)) | 1384 | if (!isatty(0) || !isatty(1)) |
@@ -1399,7 +1399,7 @@ extern int fsck_minix_main(int argc, char **argv) | |||
1399 | * flags and whether or not the -f switch was specified on the | 1399 | * flags and whether or not the -f switch was specified on the |
1400 | * command line. | 1400 | * command line. |
1401 | */ | 1401 | */ |
1402 | printf("%s, %s\n", applet_name, program_version); | 1402 | printf("%s, %s\n", bb_applet_name, program_version); |
1403 | if (!(Super.s_state & MINIX_ERROR_FS) && | 1403 | if (!(Super.s_state & MINIX_ERROR_FS) && |
1404 | (Super.s_state & MINIX_VALID_FS) && !force) { | 1404 | (Super.s_state & MINIX_VALID_FS) && !force) { |
1405 | if (repair) | 1405 | if (repair) |
diff --git a/util-linux/getopt.c b/util-linux/getopt.c index e126d7b6e..25eeab69b 100644 --- a/util-linux/getopt.c +++ b/util-linux/getopt.c | |||
@@ -37,7 +37,7 @@ | |||
37 | * <misiek@misiek.eu.org>) | 37 | * <misiek@misiek.eu.org>) |
38 | * Ported to Busybox - Alfred M. Szmidt <ams@trillian.itslinux.org> | 38 | * Ported to Busybox - Alfred M. Szmidt <ams@trillian.itslinux.org> |
39 | * Removed --version/-V and --help/-h in | 39 | * Removed --version/-V and --help/-h in |
40 | * Removed prase_error(), using error_msg() from Busybox instead | 40 | * Removed prase_error(), using bb_error_msg() from Busybox instead |
41 | * Replaced our_malloc with xmalloc and our_realloc with xrealloc | 41 | * Replaced our_malloc with xmalloc and our_realloc with xrealloc |
42 | * | 42 | * |
43 | */ | 43 | */ |
@@ -95,7 +95,7 @@ const char *normalize(const char *arg) | |||
95 | free(BUFFER); | 95 | free(BUFFER); |
96 | 96 | ||
97 | if (!quote) { /* Just copy arg */ | 97 | if (!quote) { /* Just copy arg */ |
98 | BUFFER=xstrdup(arg); | 98 | BUFFER=bb_xstrdup(arg); |
99 | return BUFFER; | 99 | return BUFFER; |
100 | } | 100 | } |
101 | 101 | ||
@@ -224,7 +224,7 @@ void add_longopt(const char *name,int has_arg) | |||
224 | long_options[long_options_nr-1].has_arg=has_arg; | 224 | long_options[long_options_nr-1].has_arg=has_arg; |
225 | long_options[long_options_nr-1].flag=NULL; | 225 | long_options[long_options_nr-1].flag=NULL; |
226 | long_options[long_options_nr-1].val=LONG_OPT; | 226 | long_options[long_options_nr-1].val=LONG_OPT; |
227 | long_options[long_options_nr-1].name=xstrdup(name); | 227 | long_options[long_options_nr-1].name=bb_xstrdup(name); |
228 | } | 228 | } |
229 | long_options_nr++; | 229 | long_options_nr++; |
230 | } | 230 | } |
@@ -254,7 +254,7 @@ void add_long_options(char *options) | |||
254 | arg_opt=required_argument; | 254 | arg_opt=required_argument; |
255 | } | 255 | } |
256 | if (tlen == 0) | 256 | if (tlen == 0) |
257 | error_msg("empty long option after -l or --long argument"); | 257 | bb_error_msg("empty long option after -l or --long argument"); |
258 | } | 258 | } |
259 | add_longopt(tokptr,arg_opt); | 259 | add_longopt(tokptr,arg_opt); |
260 | } | 260 | } |
@@ -273,7 +273,7 @@ void set_shell(const char *new_shell) | |||
273 | else if (!strcmp(new_shell,"csh")) | 273 | else if (!strcmp(new_shell,"csh")) |
274 | shell=TCSH; | 274 | shell=TCSH; |
275 | else | 275 | else |
276 | error_msg("unknown shell after -s or --shell argument"); | 276 | bb_error_msg("unknown shell after -s or --shell argument"); |
277 | } | 277 | } |
278 | 278 | ||
279 | 279 | ||
@@ -322,7 +322,7 @@ int getopt_main(int argc, char *argv[]) | |||
322 | printf(" --\n"); | 322 | printf(" --\n"); |
323 | return 0; | 323 | return 0; |
324 | } else | 324 | } else |
325 | error_msg_and_die("missing optstring argument"); | 325 | bb_error_msg_and_die("missing optstring argument"); |
326 | } | 326 | } |
327 | 327 | ||
328 | if (argv[1][0] != '-' || compatible) { | 328 | if (argv[1][0] != '-' || compatible) { |
@@ -340,14 +340,14 @@ int getopt_main(int argc, char *argv[]) | |||
340 | break; | 340 | break; |
341 | case 'o': | 341 | case 'o': |
342 | free(optstr); | 342 | free(optstr); |
343 | optstr=xstrdup(optarg); | 343 | optstr=bb_xstrdup(optarg); |
344 | break; | 344 | break; |
345 | case 'l': | 345 | case 'l': |
346 | add_long_options(optarg); | 346 | add_long_options(optarg); |
347 | break; | 347 | break; |
348 | case 'n': | 348 | case 'n': |
349 | free(name); | 349 | free(name); |
350 | name=xstrdup(optarg); | 350 | name=bb_xstrdup(optarg); |
351 | break; | 351 | break; |
352 | case 'q': | 352 | case 'q': |
353 | quiet_errors=1; | 353 | quiet_errors=1; |
@@ -364,14 +364,14 @@ int getopt_main(int argc, char *argv[]) | |||
364 | quote=0; | 364 | quote=0; |
365 | break; | 365 | break; |
366 | default: | 366 | default: |
367 | show_usage(); | 367 | bb_show_usage(); |
368 | } | 368 | } |
369 | 369 | ||
370 | if (!optstr) { | 370 | if (!optstr) { |
371 | if (optind >= argc) | 371 | if (optind >= argc) |
372 | error_msg_and_die("missing optstring argument"); | 372 | bb_error_msg_and_die("missing optstring argument"); |
373 | else { | 373 | else { |
374 | optstr=xstrdup(argv[optind]); | 374 | optstr=bb_xstrdup(argv[optind]); |
375 | optind++; | 375 | optind++; |
376 | } | 376 | } |
377 | } | 377 | } |
diff --git a/util-linux/hexdump.c b/util-linux/hexdump.c index 33648f918..1858b08d4 100644 --- a/util-linux/hexdump.c +++ b/util-linux/hexdump.c | |||
@@ -25,115 +25,92 @@ | |||
25 | #include <getopt.h> | 25 | #include <getopt.h> |
26 | #include <stdlib.h> | 26 | #include <stdlib.h> |
27 | #include <string.h> | 27 | #include <string.h> |
28 | #include "dump.h" | ||
29 | #include "busybox.h" | 28 | #include "busybox.h" |
29 | #include "dump.h" | ||
30 | 30 | ||
31 | extern off_t skip; /* bytes to skip */ | 31 | static void bb_dump_addfile(char *name) |
32 | |||
33 | extern FS *fshead; /* head of format strings */ | ||
34 | extern int blocksize; /* data block size */ | ||
35 | extern int length; /* max bytes to read */ | ||
36 | |||
37 | void addfile(char *name) | ||
38 | { | 32 | { |
39 | register char *p; | 33 | register char *p; |
40 | FILE *fp; | 34 | FILE *fp; |
41 | int ch; | 35 | char *buf; |
42 | char buf[2048 + 1]; | ||
43 | 36 | ||
44 | if (!(fp = fopen(name, "r"))) { | 37 | fp = bb_xfopen(name, "r"); |
45 | error_msg_and_die("hexdump: can't read %s.\n", name); | 38 | |
46 | } | 39 | while ((buf = bb_get_chomped_line_from_file(fp)) != NULL) { |
47 | while (fgets(buf, sizeof(buf), fp)) { | 40 | p = (char *) bb_skip_whitespace(buf); |
48 | if (!(p = index(buf, '\n'))) { | 41 | |
49 | error_msg("hexdump: line too long.\n"); | 42 | if (*p && (*p != '#')) { |
50 | while ((ch = getchar()) != '\n' && ch != EOF); | 43 | bb_dump_add(p); |
51 | continue; | ||
52 | } | ||
53 | *p = '\0'; | ||
54 | for (p = buf; *p && isspace(*p); ++p); | ||
55 | if (!*p || *p == '#') { | ||
56 | continue; | ||
57 | } | 44 | } |
58 | add(p); | 45 | free(buf); |
59 | } | 46 | } |
60 | (void)fclose(fp); | 47 | fclose(fp); |
61 | } | 48 | } |
62 | 49 | ||
50 | static const char * const add_strings[] = { | ||
51 | "\"%07.7_ax \" 16/1 \"%03o \" \"\\n\"", /* b */ | ||
52 | "\"%07.7_ax \" 16/1 \"%3_c \" \"\\n\"", /* c */ | ||
53 | "\"%07.7_ax \" 8/2 \" %05u \" \"\\n\"", /* d */ | ||
54 | "\"%07.7_ax \" 8/2 \" %06o \" \"\\n\"", /* o */ | ||
55 | "\"%07.7_ax \" 8/2 \" %04x \" \"\\n\"", /* x */ | ||
56 | }; | ||
57 | |||
58 | static const char add_first[] = "\"%07.7_Ax\n\""; | ||
59 | |||
60 | static const char hexdump_opts[] = "bcdoxe:f:n:s:v"; | ||
61 | |||
62 | static const struct suffix_mult suffixes[] = { | ||
63 | {"b", 512 }, | ||
64 | {"k", 1024 }, | ||
65 | {"m", 1024*1024 }, | ||
66 | {NULL, 0 } | ||
67 | }; | ||
68 | |||
63 | int hexdump_main(int argc, char **argv) | 69 | int hexdump_main(int argc, char **argv) |
64 | { | 70 | { |
65 | // register FS *tfs; | 71 | // register FS *tfs; |
66 | char *p; | 72 | const char *p; |
67 | int ch; | 73 | int ch; |
68 | extern enum _vflag vflag; | ||
69 | vflag = FIRST; | ||
70 | length = -1; | ||
71 | 74 | ||
72 | while ((ch = getopt(argc, argv, "bcde:f:n:os:vx")) != EOF) { | 75 | bb_dump_vflag = FIRST; |
73 | switch (ch) { | 76 | bb_dump_length = -1; |
74 | case 'b': | 77 | |
75 | add("\"%07.7_Ax\n\""); | 78 | while ((ch = getopt(argc, argv, hexdump_opts)) > 0) { |
76 | add("\"%07.7_ax \" 16/1 \"%03o \" \"\\n\""); | 79 | if ((p = strchr(hexdump_opts, ch)) != NULL) { |
77 | break; | 80 | if ((p - hexdump_opts) < 5) { |
78 | case 'c': | 81 | bb_dump_add(add_first); |
79 | add("\"%07.7_Ax\n\""); | 82 | bb_dump_add(add_strings[(int)(p - hexdump_opts)]); |
80 | add("\"%07.7_ax \" 16/1 \"%3_c \" \"\\n\""); | 83 | } else { |
81 | break; | 84 | /* Sae a little bit of space below by omitting the 'else's. */ |
82 | case 'd': | 85 | if (ch == 'e') { |
83 | add("\"%07.7_Ax\n\""); | 86 | bb_dump_add(optarg); |
84 | add("\"%07.7_ax \" 8/2 \" %05u \" \"\\n\""); | 87 | } /* else */ |
85 | break; | 88 | if (ch == 'f') { |
86 | case 'e': | 89 | bb_dump_addfile(optarg); |
87 | add(optarg); | 90 | } /* else */ |
88 | break; | 91 | if (ch == 'n') { |
89 | case 'f': | 92 | bb_dump_length = bb_xgetularg10_bnd(optarg, 0, INT_MAX); |
90 | addfile(optarg); | 93 | } /* else */ |
91 | break; | 94 | if (ch == 's') { |
92 | case 'n': | 95 | bb_dump_skip = bb_xgetularg_bnd_sfx(optarg, 10, 0, LONG_MAX, suffixes); |
93 | if ((length = atoi(optarg)) < 0) { | 96 | } /* else */ |
94 | error_msg_and_die("hexdump: bad length value.\n"); | 97 | if (ch == 'v') { |
95 | } | 98 | bb_dump_vflag = ALL; |
96 | break; | 99 | } |
97 | case 'o': | ||
98 | add("\"%07.7_Ax\n\""); | ||
99 | add("\"%07.7_ax \" 8/2 \" %06o \" \"\\n\""); | ||
100 | break; | ||
101 | case 's': | ||
102 | if ((skip = strtol(optarg, &p, 0)) < 0) { | ||
103 | error_msg_and_die("hexdump: bad skip value.\n"); | ||
104 | } | ||
105 | switch(*p) { | ||
106 | case 'b': | ||
107 | skip *= 512; | ||
108 | break; | ||
109 | case 'k': | ||
110 | skip *= 1024; | ||
111 | break; | ||
112 | case 'm': | ||
113 | skip *= 1048576; | ||
114 | break; | ||
115 | } | 100 | } |
116 | break; | 101 | } else { |
117 | case 'v': | 102 | bb_show_usage(); |
118 | vflag = ALL; | ||
119 | break; | ||
120 | case 'x': | ||
121 | add("\"%07.7_Ax\n\""); | ||
122 | add("\"%07.7_ax \" 8/2 \" %04x \" \"\\n\""); | ||
123 | break; | ||
124 | case '?': | ||
125 | show_usage(); | ||
126 | } | 103 | } |
127 | } | 104 | } |
128 | 105 | ||
129 | if (!fshead) { | 106 | if (!bb_dump_fshead) { |
130 | add("\"%07.7_Ax\n\""); | 107 | bb_dump_add(add_first); |
131 | add("\"%07.7_ax \" 8/2 \"%04x \" \"\\n\""); | 108 | bb_dump_add("\"%07.7_ax \" 8/2 \"%04x \" \"\\n\""); |
132 | } | 109 | } |
133 | 110 | ||
134 | argv += optind; | 111 | argv += optind; |
135 | 112 | ||
136 | return(dump(argv)); | 113 | return(bb_dump_dump(argv)); |
137 | } | 114 | } |
138 | /* | 115 | /* |
139 | * Copyright (c) 1989 The Regents of the University of California. | 116 | * Copyright (c) 1989 The Regents of the University of California. |
diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c index 815b60b21..2eee3cfdb 100644 --- a/util-linux/hwclock.c +++ b/util-linux/hwclock.c | |||
@@ -77,11 +77,11 @@ time_t read_rtc ( int utc ) | |||
77 | 77 | ||
78 | if (( rtc = open ( "/dev/rtc", O_RDONLY )) < 0 ) { | 78 | if (( rtc = open ( "/dev/rtc", O_RDONLY )) < 0 ) { |
79 | if (( rtc = open ( "/dev/misc/rtc", O_RDONLY )) < 0 ) | 79 | if (( rtc = open ( "/dev/misc/rtc", O_RDONLY )) < 0 ) |
80 | perror_msg_and_die ( "Could not access RTC" ); | 80 | bb_perror_msg_and_die ( "Could not access RTC" ); |
81 | } | 81 | } |
82 | memset ( &tm, 0, sizeof( struct tm )); | 82 | memset ( &tm, 0, sizeof( struct tm )); |
83 | if ( ioctl ( rtc, RTC_RD_TIME, &tm ) < 0 ) | 83 | if ( ioctl ( rtc, RTC_RD_TIME, &tm ) < 0 ) |
84 | perror_msg_and_die ( "Could not read time from RTC" ); | 84 | bb_perror_msg_and_die ( "Could not read time from RTC" ); |
85 | tm. tm_isdst = -1; // not known | 85 | tm. tm_isdst = -1; // not known |
86 | 86 | ||
87 | close ( rtc ); | 87 | close ( rtc ); |
@@ -111,7 +111,7 @@ void write_rtc ( time_t t, int utc ) | |||
111 | 111 | ||
112 | if (( rtc = open ( "/dev/rtc", O_WRONLY )) < 0 ) { | 112 | if (( rtc = open ( "/dev/rtc", O_WRONLY )) < 0 ) { |
113 | if (( rtc = open ( "/dev/misc/rtc", O_WRONLY )) < 0 ) | 113 | if (( rtc = open ( "/dev/misc/rtc", O_WRONLY )) < 0 ) |
114 | perror_msg_and_die ( "Could not access RTC" ); | 114 | bb_perror_msg_and_die ( "Could not access RTC" ); |
115 | } | 115 | } |
116 | 116 | ||
117 | printf ( "1\n" ); | 117 | printf ( "1\n" ); |
@@ -122,7 +122,7 @@ void write_rtc ( time_t t, int utc ) | |||
122 | printf ( "2\n") ; | 122 | printf ( "2\n") ; |
123 | 123 | ||
124 | if ( ioctl ( rtc, RTC_SET_TIME, &tm ) < 0 ) | 124 | if ( ioctl ( rtc, RTC_SET_TIME, &tm ) < 0 ) |
125 | perror_msg_and_die ( "Could not set the RTC time" ); | 125 | bb_perror_msg_and_die ( "Could not set the RTC time" ); |
126 | 126 | ||
127 | close ( rtc ); | 127 | close ( rtc ); |
128 | } | 128 | } |
@@ -138,7 +138,7 @@ int show_clock ( int utc ) | |||
138 | 138 | ||
139 | safe_strncpy ( buffer, ctime ( &t ), sizeof( buffer )); | 139 | safe_strncpy ( buffer, ctime ( &t ), sizeof( buffer )); |
140 | if ( buffer [0] ) | 140 | if ( buffer [0] ) |
141 | buffer [xstrlen ( buffer ) - 1] = 0; | 141 | buffer [bb_strlen ( buffer ) - 1] = 0; |
142 | 142 | ||
143 | //printf ( "%s %.6f seconds %s\n", buffer, 0.0, utc ? "" : ( ptm-> tm_isdst ? tzname [1] : tzname [0] )); | 143 | //printf ( "%s %.6f seconds %s\n", buffer, 0.0, utc ? "" : ( ptm-> tm_isdst ? tzname [1] : tzname [0] )); |
144 | printf ( "%s %.6f seconds\n", buffer, 0.0 ); | 144 | printf ( "%s %.6f seconds\n", buffer, 0.0 ); |
@@ -154,7 +154,7 @@ int to_sys_clock ( int utc ) | |||
154 | tv. tv_sec = read_rtc ( utc ); | 154 | tv. tv_sec = read_rtc ( utc ); |
155 | 155 | ||
156 | if ( settimeofday ( &tv, &tz )) | 156 | if ( settimeofday ( &tv, &tz )) |
157 | perror_msg_and_die ( "settimeofday() failed" ); | 157 | bb_perror_msg_and_die ( "settimeofday() failed" ); |
158 | 158 | ||
159 | return 0; | 159 | return 0; |
160 | } | 160 | } |
@@ -165,7 +165,7 @@ int from_sys_clock ( int utc ) | |||
165 | struct timezone tz = { 0, 0 }; | 165 | struct timezone tz = { 0, 0 }; |
166 | 166 | ||
167 | if ( gettimeofday ( &tv, &tz )) | 167 | if ( gettimeofday ( &tv, &tz )) |
168 | perror_msg_and_die ( "gettimeofday() failed" ); | 168 | bb_perror_msg_and_die ( "gettimeofday() failed" ); |
169 | 169 | ||
170 | write_rtc ( tv. tv_sec, utc ); | 170 | write_rtc ( tv. tv_sec, utc ); |
171 | return 0; | 171 | return 0; |
@@ -181,7 +181,7 @@ int check_utc ( void ) | |||
181 | char buffer [128]; | 181 | char buffer [128]; |
182 | 182 | ||
183 | while ( fgets ( buffer, sizeof( buffer ), f )) { | 183 | while ( fgets ( buffer, sizeof( buffer ), f )) { |
184 | int len = xstrlen ( buffer ); | 184 | int len = bb_strlen ( buffer ); |
185 | 185 | ||
186 | while ( len && isspace ( buffer [len - 1] )) | 186 | while ( len && isspace ( buffer [len - 1] )) |
187 | len--; | 187 | len--; |
@@ -238,7 +238,7 @@ extern int hwclock_main ( int argc, char **argv ) | |||
238 | utc_arg = 1; | 238 | utc_arg = 1; |
239 | break; | 239 | break; |
240 | default: | 240 | default: |
241 | show_usage(); | 241 | bb_show_usage(); |
242 | break; | 242 | break; |
243 | } | 243 | } |
244 | } | 244 | } |
diff --git a/util-linux/losetup.c b/util-linux/losetup.c index bfeb6b274..e2ea538d5 100644 --- a/util-linux/losetup.c +++ b/util-linux/losetup.c | |||
@@ -39,16 +39,16 @@ losetup_main (int argc, char **argv) | |||
39 | break; | 39 | break; |
40 | 40 | ||
41 | case 'o': | 41 | case 'o': |
42 | offset = parse_number (optarg, NULL); | 42 | offset = bb_xparse_number (optarg, NULL); |
43 | break; | 43 | break; |
44 | 44 | ||
45 | default: | 45 | default: |
46 | show_usage (); | 46 | bb_show_usage(); |
47 | } | 47 | } |
48 | 48 | ||
49 | if ((delete && (offset || optind + 1 != argc)) | 49 | if ((delete && (offset || optind + 1 != argc)) |
50 | || (!delete && optind + 2 != argc)) | 50 | || (!delete && optind + 2 != argc)) |
51 | show_usage (); | 51 | bb_show_usage(); |
52 | 52 | ||
53 | if (delete) | 53 | if (delete) |
54 | return del_loop (argv[optind]) ? EXIT_SUCCESS : EXIT_FAILURE; | 54 | return del_loop (argv[optind]) ? EXIT_SUCCESS : EXIT_FAILURE; |
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c index 94f29e55d..75a909e6b 100644 --- a/util-linux/mkfs_minix.c +++ b/util-linux/mkfs_minix.c | |||
@@ -268,7 +268,7 @@ extern inline void check_mount(void) | |||
268 | if (!mnt) | 268 | if (!mnt) |
269 | return; | 269 | return; |
270 | 270 | ||
271 | error_msg_and_die("%s is mounted; will not make a filesystem here!", device_name); | 271 | bb_error_msg_and_die("%s is mounted; will not make a filesystem here!", device_name); |
272 | } | 272 | } |
273 | 273 | ||
274 | static long valid_offset(int fd, int offset) | 274 | static long valid_offset(int fd, int offset) |
@@ -307,7 +307,7 @@ extern inline int get_size(const char *file) | |||
307 | long size; | 307 | long size; |
308 | 308 | ||
309 | if ((fd = open(file, O_RDWR)) < 0) | 309 | if ((fd = open(file, O_RDWR)) < 0) |
310 | perror_msg_and_die("%s", file); | 310 | bb_perror_msg_and_die("%s", file); |
311 | if (ioctl(fd, BLKGETSIZE, &size) >= 0) { | 311 | if (ioctl(fd, BLKGETSIZE, &size) >= 0) { |
312 | close(fd); | 312 | close(fd); |
313 | return (size * 512); | 313 | return (size * 512); |
@@ -325,28 +325,28 @@ extern inline void write_tables(void) | |||
325 | Super.s_state &= ~MINIX_ERROR_FS; | 325 | Super.s_state &= ~MINIX_ERROR_FS; |
326 | 326 | ||
327 | if (lseek(DEV, 0, SEEK_SET)) | 327 | if (lseek(DEV, 0, SEEK_SET)) |
328 | error_msg_and_die("seek to boot block failed in write_tables"); | 328 | bb_error_msg_and_die("seek to boot block failed in write_tables"); |
329 | if (512 != write(DEV, boot_block_buffer, 512)) | 329 | if (512 != write(DEV, boot_block_buffer, 512)) |
330 | error_msg_and_die("unable to clear boot sector"); | 330 | bb_error_msg_and_die("unable to clear boot sector"); |
331 | if (BLOCK_SIZE != lseek(DEV, BLOCK_SIZE, SEEK_SET)) | 331 | if (BLOCK_SIZE != lseek(DEV, BLOCK_SIZE, SEEK_SET)) |
332 | error_msg_and_die("seek failed in write_tables"); | 332 | bb_error_msg_and_die("seek failed in write_tables"); |
333 | if (BLOCK_SIZE != write(DEV, super_block_buffer, BLOCK_SIZE)) | 333 | if (BLOCK_SIZE != write(DEV, super_block_buffer, BLOCK_SIZE)) |
334 | error_msg_and_die("unable to write super-block"); | 334 | bb_error_msg_and_die("unable to write super-block"); |
335 | if (IMAPS * BLOCK_SIZE != write(DEV, inode_map, IMAPS * BLOCK_SIZE)) | 335 | if (IMAPS * BLOCK_SIZE != write(DEV, inode_map, IMAPS * BLOCK_SIZE)) |
336 | error_msg_and_die("unable to write inode map"); | 336 | bb_error_msg_and_die("unable to write inode map"); |
337 | if (ZMAPS * BLOCK_SIZE != write(DEV, zone_map, ZMAPS * BLOCK_SIZE)) | 337 | if (ZMAPS * BLOCK_SIZE != write(DEV, zone_map, ZMAPS * BLOCK_SIZE)) |
338 | error_msg_and_die("unable to write zone map"); | 338 | bb_error_msg_and_die("unable to write zone map"); |
339 | if (INODE_BUFFER_SIZE != write(DEV, inode_buffer, INODE_BUFFER_SIZE)) | 339 | if (INODE_BUFFER_SIZE != write(DEV, inode_buffer, INODE_BUFFER_SIZE)) |
340 | error_msg_and_die("unable to write inodes"); | 340 | bb_error_msg_and_die("unable to write inodes"); |
341 | 341 | ||
342 | } | 342 | } |
343 | 343 | ||
344 | static void write_block(int blk, char *buffer) | 344 | static void write_block(int blk, char *buffer) |
345 | { | 345 | { |
346 | if (blk * BLOCK_SIZE != lseek(DEV, blk * BLOCK_SIZE, SEEK_SET)) | 346 | if (blk * BLOCK_SIZE != lseek(DEV, blk * BLOCK_SIZE, SEEK_SET)) |
347 | error_msg_and_die("seek failed in write_block"); | 347 | bb_error_msg_and_die("seek failed in write_block"); |
348 | if (BLOCK_SIZE != write(DEV, buffer, BLOCK_SIZE)) | 348 | if (BLOCK_SIZE != write(DEV, buffer, BLOCK_SIZE)) |
349 | error_msg_and_die("write failed in write_block"); | 349 | bb_error_msg_and_die("write failed in write_block"); |
350 | } | 350 | } |
351 | 351 | ||
352 | static int get_free_block(void) | 352 | static int get_free_block(void) |
@@ -354,7 +354,7 @@ static int get_free_block(void) | |||
354 | int blk; | 354 | int blk; |
355 | 355 | ||
356 | if (used_good_blocks + 1 >= MAX_GOOD_BLOCKS) | 356 | if (used_good_blocks + 1 >= MAX_GOOD_BLOCKS) |
357 | error_msg_and_die("too many bad blocks"); | 357 | bb_error_msg_and_die("too many bad blocks"); |
358 | if (used_good_blocks) | 358 | if (used_good_blocks) |
359 | blk = good_blocks_table[used_good_blocks - 1] + 1; | 359 | blk = good_blocks_table[used_good_blocks - 1] + 1; |
360 | else | 360 | else |
@@ -362,7 +362,7 @@ static int get_free_block(void) | |||
362 | while (blk < ZONES && zone_in_use(blk)) | 362 | while (blk < ZONES && zone_in_use(blk)) |
363 | blk++; | 363 | blk++; |
364 | if (blk >= ZONES) | 364 | if (blk >= ZONES) |
365 | error_msg_and_die("not enough good blocks"); | 365 | bb_error_msg_and_die("not enough good blocks"); |
366 | good_blocks_table[used_good_blocks] = blk; | 366 | good_blocks_table[used_good_blocks] = blk; |
367 | used_good_blocks++; | 367 | used_good_blocks++; |
368 | return blk; | 368 | return blk; |
@@ -428,7 +428,7 @@ extern inline void make_bad_inode(void) | |||
428 | goto end_bad; | 428 | goto end_bad; |
429 | } | 429 | } |
430 | } | 430 | } |
431 | error_msg_and_die("too many bad blocks"); | 431 | bb_error_msg_and_die("too many bad blocks"); |
432 | end_bad: | 432 | end_bad: |
433 | if (ind) | 433 | if (ind) |
434 | write_block(ind, (char *) ind_block); | 434 | write_block(ind, (char *) ind_block); |
@@ -478,7 +478,7 @@ extern inline void make_bad_inode2(void) | |||
478 | } | 478 | } |
479 | } | 479 | } |
480 | /* Could make triple indirect block here */ | 480 | /* Could make triple indirect block here */ |
481 | error_msg_and_die("too many bad blocks"); | 481 | bb_error_msg_and_die("too many bad blocks"); |
482 | end_bad: | 482 | end_bad: |
483 | if (ind) | 483 | if (ind) |
484 | write_block(ind, (char *) ind_block); | 484 | write_block(ind, (char *) ind_block); |
@@ -579,7 +579,7 @@ extern inline void setup_tables(void) | |||
579 | * /sbin/mkfs.minix -i 200 test.fs | 579 | * /sbin/mkfs.minix -i 200 test.fs |
580 | * */ | 580 | * */ |
581 | if (i >= 999) { | 581 | if (i >= 999) { |
582 | error_msg_and_die("unable to allocate buffers for maps"); | 582 | bb_error_msg_and_die("unable to allocate buffers for maps"); |
583 | } | 583 | } |
584 | FIRSTZONE = NORM_FIRSTZONE; | 584 | FIRSTZONE = NORM_FIRSTZONE; |
585 | inode_map = xmalloc(IMAPS * BLOCK_SIZE); | 585 | inode_map = xmalloc(IMAPS * BLOCK_SIZE); |
@@ -610,7 +610,7 @@ extern inline long do_check(char *buffer, int try, unsigned int current_block) | |||
610 | /* Seek to the correct loc. */ | 610 | /* Seek to the correct loc. */ |
611 | if (lseek(DEV, current_block * BLOCK_SIZE, SEEK_SET) != | 611 | if (lseek(DEV, current_block * BLOCK_SIZE, SEEK_SET) != |
612 | current_block * BLOCK_SIZE) { | 612 | current_block * BLOCK_SIZE) { |
613 | error_msg_and_die("seek failed during testing of blocks"); | 613 | bb_error_msg_and_die("seek failed during testing of blocks"); |
614 | } | 614 | } |
615 | 615 | ||
616 | 616 | ||
@@ -650,7 +650,7 @@ static void check_blocks(void) | |||
650 | while (currently_testing < ZONES) { | 650 | while (currently_testing < ZONES) { |
651 | if (lseek(DEV, currently_testing * BLOCK_SIZE, SEEK_SET) != | 651 | if (lseek(DEV, currently_testing * BLOCK_SIZE, SEEK_SET) != |
652 | currently_testing * BLOCK_SIZE) | 652 | currently_testing * BLOCK_SIZE) |
653 | error_msg_and_die("seek failed in check_blocks"); | 653 | bb_error_msg_and_die("seek failed in check_blocks"); |
654 | try = TEST_BUFFER_BLOCKS; | 654 | try = TEST_BUFFER_BLOCKS; |
655 | if (currently_testing + try > ZONES) | 655 | if (currently_testing + try > ZONES) |
656 | try = ZONES - currently_testing; | 656 | try = ZONES - currently_testing; |
@@ -659,7 +659,7 @@ static void check_blocks(void) | |||
659 | if (got == try) | 659 | if (got == try) |
660 | continue; | 660 | continue; |
661 | if (currently_testing < FIRSTZONE) | 661 | if (currently_testing < FIRSTZONE) |
662 | error_msg_and_die("bad blocks before data-area: cannot make fs"); | 662 | bb_error_msg_and_die("bad blocks before data-area: cannot make fs"); |
663 | mark_zone(currently_testing); | 663 | mark_zone(currently_testing); |
664 | badblocks++; | 664 | badblocks++; |
665 | currently_testing++; | 665 | currently_testing++; |
@@ -675,7 +675,7 @@ static void get_list_blocks(char *filename) | |||
675 | FILE *listfile; | 675 | FILE *listfile; |
676 | unsigned long blockno; | 676 | unsigned long blockno; |
677 | 677 | ||
678 | listfile = xfopen(filename, "r"); | 678 | listfile = bb_xfopen(filename, "r"); |
679 | while (!feof(listfile)) { | 679 | while (!feof(listfile)) { |
680 | fscanf(listfile, "%ld\n", &blockno); | 680 | fscanf(listfile, "%ld\n", &blockno); |
681 | mark_zone(blockno); | 681 | mark_zone(blockno); |
@@ -696,10 +696,10 @@ extern int mkfs_minix_main(int argc, char **argv) | |||
696 | int stopIt=FALSE; | 696 | int stopIt=FALSE; |
697 | 697 | ||
698 | if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE) | 698 | if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE) |
699 | error_msg_and_die("bad inode size"); | 699 | bb_error_msg_and_die("bad inode size"); |
700 | #ifdef CONFIG_FEATURE_MINIX2 | 700 | #ifdef CONFIG_FEATURE_MINIX2 |
701 | if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE) | 701 | if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE) |
702 | error_msg_and_die("bad inode size"); | 702 | bb_error_msg_and_die("bad inode size"); |
703 | #endif | 703 | #endif |
704 | 704 | ||
705 | /* Parse options */ | 705 | /* Parse options */ |
@@ -725,7 +725,7 @@ extern int mkfs_minix_main(int argc, char **argv) | |||
725 | } | 725 | } |
726 | req_nr_inodes = strtoul(cp, &tmp, 0); | 726 | req_nr_inodes = strtoul(cp, &tmp, 0); |
727 | if (*tmp) | 727 | if (*tmp) |
728 | show_usage(); | 728 | bb_show_usage(); |
729 | stopIt=TRUE; | 729 | stopIt=TRUE; |
730 | break; | 730 | break; |
731 | } | 731 | } |
@@ -749,13 +749,13 @@ extern int mkfs_minix_main(int argc, char **argv) | |||
749 | } | 749 | } |
750 | i = strtoul(cp, &tmp, 0); | 750 | i = strtoul(cp, &tmp, 0); |
751 | if (*tmp) | 751 | if (*tmp) |
752 | show_usage(); | 752 | bb_show_usage(); |
753 | if (i == 14) | 753 | if (i == 14) |
754 | magic = MINIX_SUPER_MAGIC; | 754 | magic = MINIX_SUPER_MAGIC; |
755 | else if (i == 30) | 755 | else if (i == 30) |
756 | magic = MINIX_SUPER_MAGIC2; | 756 | magic = MINIX_SUPER_MAGIC2; |
757 | else | 757 | else |
758 | show_usage(); | 758 | bb_show_usage(); |
759 | namelen = i; | 759 | namelen = i; |
760 | dirsize = i + 2; | 760 | dirsize = i + 2; |
761 | stopIt=TRUE; | 761 | stopIt=TRUE; |
@@ -765,7 +765,7 @@ extern int mkfs_minix_main(int argc, char **argv) | |||
765 | #ifdef CONFIG_FEATURE_MINIX2 | 765 | #ifdef CONFIG_FEATURE_MINIX2 |
766 | version2 = 1; | 766 | version2 = 1; |
767 | #else | 767 | #else |
768 | error_msg("%s: not compiled with minix v2 support", | 768 | bb_error_msg("%s: not compiled with minix v2 support", |
769 | device_name); | 769 | device_name); |
770 | exit(-1); | 770 | exit(-1); |
771 | #endif | 771 | #endif |
@@ -774,7 +774,7 @@ extern int mkfs_minix_main(int argc, char **argv) | |||
774 | case 'h': | 774 | case 'h': |
775 | default: | 775 | default: |
776 | goodbye: | 776 | goodbye: |
777 | show_usage(); | 777 | bb_show_usage(); |
778 | } | 778 | } |
779 | } | 779 | } |
780 | } else { | 780 | } else { |
@@ -792,7 +792,7 @@ goodbye: | |||
792 | if (device_name && !BLOCKS) | 792 | if (device_name && !BLOCKS) |
793 | BLOCKS = get_size(device_name) / 1024; | 793 | BLOCKS = get_size(device_name) / 1024; |
794 | if (!device_name || BLOCKS < 10) { | 794 | if (!device_name || BLOCKS < 10) { |
795 | show_usage(); | 795 | bb_show_usage(); |
796 | } | 796 | } |
797 | #ifdef CONFIG_FEATURE_MINIX2 | 797 | #ifdef CONFIG_FEATURE_MINIX2 |
798 | if (version2) { | 798 | if (version2) { |
@@ -816,13 +816,13 @@ goodbye: | |||
816 | strcpy(tmp + 2, ".badblocks"); | 816 | strcpy(tmp + 2, ".badblocks"); |
817 | DEV = open(device_name, O_RDWR); | 817 | DEV = open(device_name, O_RDWR); |
818 | if (DEV < 0) | 818 | if (DEV < 0) |
819 | error_msg_and_die("unable to open %s", device_name); | 819 | bb_error_msg_and_die("unable to open %s", device_name); |
820 | if (fstat(DEV, &statbuf) < 0) | 820 | if (fstat(DEV, &statbuf) < 0) |
821 | error_msg_and_die("unable to stat %s", device_name); | 821 | bb_error_msg_and_die("unable to stat %s", device_name); |
822 | if (!S_ISBLK(statbuf.st_mode)) | 822 | if (!S_ISBLK(statbuf.st_mode)) |
823 | check = 0; | 823 | check = 0; |
824 | else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340) | 824 | else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340) |
825 | error_msg_and_die("will not try to make filesystem on '%s'", device_name); | 825 | bb_error_msg_and_die("will not try to make filesystem on '%s'", device_name); |
826 | setup_tables(); | 826 | setup_tables(); |
827 | if (check) | 827 | if (check) |
828 | check_blocks(); | 828 | check_blocks(); |
diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c index de10ba71f..15db392d2 100644 --- a/util-linux/mkswap.c +++ b/util-linux/mkswap.c | |||
@@ -87,7 +87,7 @@ static inline void init_signature_page(void) | |||
87 | 87 | ||
88 | #ifdef PAGE_SIZE | 88 | #ifdef PAGE_SIZE |
89 | if (pagesize != PAGE_SIZE) | 89 | if (pagesize != PAGE_SIZE) |
90 | error_msg("Assuming pages of size %d", pagesize); | 90 | bb_error_msg("Assuming pages of size %d", pagesize); |
91 | #endif | 91 | #endif |
92 | signature_page = (int *) xmalloc(pagesize); | 92 | signature_page = (int *) xmalloc(pagesize); |
93 | memset(signature_page, 0, pagesize); | 93 | memset(signature_page, 0, pagesize); |
@@ -185,7 +185,7 @@ static inline void page_bad(int page) | |||
185 | bit_test_and_clear(signature_page, page); | 185 | bit_test_and_clear(signature_page, page); |
186 | else { | 186 | else { |
187 | if (badpages == MAX_BADPAGES) | 187 | if (badpages == MAX_BADPAGES) |
188 | error_msg_and_die("too many bad pages"); | 188 | bb_error_msg_and_die("too many bad pages"); |
189 | p->badpages[badpages] = page; | 189 | p->badpages[badpages] = page; |
190 | } | 190 | } |
191 | badpages++; | 191 | badpages++; |
@@ -206,7 +206,7 @@ static void check_blocks(void) | |||
206 | } | 206 | } |
207 | if (do_seek && lseek(DEV, current_page * pagesize, SEEK_SET) != | 207 | if (do_seek && lseek(DEV, current_page * pagesize, SEEK_SET) != |
208 | current_page * pagesize) | 208 | current_page * pagesize) |
209 | error_msg_and_die("seek failed in check_blocks"); | 209 | bb_error_msg_and_die("seek failed in check_blocks"); |
210 | if ((do_seek = (pagesize != read(DEV, buffer, pagesize)))) { | 210 | if ((do_seek = (pagesize != read(DEV, buffer, pagesize)))) { |
211 | page_bad(current_page++); | 211 | page_bad(current_page++); |
212 | continue; | 212 | continue; |
@@ -255,7 +255,7 @@ static long get_size(const char *file) | |||
255 | long size; | 255 | long size; |
256 | 256 | ||
257 | if ((fd = open(file, O_RDONLY)) < 0) | 257 | if ((fd = open(file, O_RDONLY)) < 0) |
258 | perror_msg_and_die("%s", file); | 258 | bb_perror_msg_and_die("%s", file); |
259 | if (ioctl(fd, BLKGETSIZE, &size) >= 0) { | 259 | if (ioctl(fd, BLKGETSIZE, &size) >= 0) { |
260 | int sectors_per_page = pagesize / 512; | 260 | int sectors_per_page = pagesize / 512; |
261 | 261 | ||
@@ -287,7 +287,7 @@ int mkswap_main(int argc, char **argv) | |||
287 | 287 | ||
288 | PAGES = strtol(argv[0], &tmp, 0) / blocks_per_page; | 288 | PAGES = strtol(argv[0], &tmp, 0) / blocks_per_page; |
289 | if (*tmp) | 289 | if (*tmp) |
290 | show_usage(); | 290 | bb_show_usage(); |
291 | } else | 291 | } else |
292 | device_name = argv[0]; | 292 | device_name = argv[0]; |
293 | } else { | 293 | } else { |
@@ -302,19 +302,19 @@ int mkswap_main(int argc, char **argv) | |||
302 | version = atoi(argv[0] + 2); | 302 | version = atoi(argv[0] + 2); |
303 | break; | 303 | break; |
304 | default: | 304 | default: |
305 | show_usage(); | 305 | bb_show_usage(); |
306 | } | 306 | } |
307 | } | 307 | } |
308 | } | 308 | } |
309 | if (!device_name) { | 309 | if (!device_name) { |
310 | error_msg("error: Nowhere to set up swap on?"); | 310 | bb_error_msg("error: Nowhere to set up swap on?"); |
311 | show_usage(); | 311 | bb_show_usage(); |
312 | } | 312 | } |
313 | sz = get_size(device_name); | 313 | sz = get_size(device_name); |
314 | if (!PAGES) { | 314 | if (!PAGES) { |
315 | PAGES = sz; | 315 | PAGES = sz; |
316 | } else if (PAGES > sz && !force) { | 316 | } else if (PAGES > sz && !force) { |
317 | error_msg("error: size %ld is larger than device size %d", | 317 | bb_error_msg("error: size %ld is larger than device size %d", |
318 | PAGES * (pagesize / 1024), sz * (pagesize / 1024)); | 318 | PAGES * (pagesize / 1024), sz * (pagesize / 1024)); |
319 | return EXIT_FAILURE; | 319 | return EXIT_FAILURE; |
320 | } | 320 | } |
@@ -330,13 +330,13 @@ int mkswap_main(int argc, char **argv) | |||
330 | version = 1; | 330 | version = 1; |
331 | } | 331 | } |
332 | if (version != 0 && version != 1) { | 332 | if (version != 0 && version != 1) { |
333 | error_msg("error: unknown version %d", version); | 333 | bb_error_msg("error: unknown version %d", version); |
334 | show_usage(); | 334 | bb_show_usage(); |
335 | } | 335 | } |
336 | if (PAGES < 10) { | 336 | if (PAGES < 10) { |
337 | error_msg("error: swap area needs to be at least %ldkB", | 337 | bb_error_msg("error: swap area needs to be at least %ldkB", |
338 | (long) (10 * pagesize / 1024)); | 338 | (long) (10 * pagesize / 1024)); |
339 | show_usage(); | 339 | bb_show_usage(); |
340 | } | 340 | } |
341 | #if 0 | 341 | #if 0 |
342 | maxpages = ((version == 0) ? V0_MAX_PAGES : V1_MAX_PAGES); | 342 | maxpages = ((version == 0) ? V0_MAX_PAGES : V1_MAX_PAGES); |
@@ -353,17 +353,17 @@ int mkswap_main(int argc, char **argv) | |||
353 | #endif | 353 | #endif |
354 | if (PAGES > maxpages) { | 354 | if (PAGES > maxpages) { |
355 | PAGES = maxpages; | 355 | PAGES = maxpages; |
356 | error_msg("warning: truncating swap area to %ldkB", | 356 | bb_error_msg("warning: truncating swap area to %ldkB", |
357 | PAGES * pagesize / 1024); | 357 | PAGES * pagesize / 1024); |
358 | } | 358 | } |
359 | 359 | ||
360 | DEV = open(device_name, O_RDWR); | 360 | DEV = open(device_name, O_RDWR); |
361 | if (DEV < 0 || fstat(DEV, &statbuf) < 0) | 361 | if (DEV < 0 || fstat(DEV, &statbuf) < 0) |
362 | perror_msg_and_die("%s", device_name); | 362 | bb_perror_msg_and_die("%s", device_name); |
363 | if (!S_ISBLK(statbuf.st_mode)) | 363 | if (!S_ISBLK(statbuf.st_mode)) |
364 | check = 0; | 364 | check = 0; |
365 | else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340) | 365 | else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340) |
366 | error_msg_and_die("Will not try to make swapdevice on '%s'", device_name); | 366 | bb_error_msg_and_die("Will not try to make swapdevice on '%s'", device_name); |
367 | 367 | ||
368 | #ifdef __sparc__ | 368 | #ifdef __sparc__ |
369 | if (!force && version == 0) { | 369 | if (!force && version == 0) { |
@@ -372,13 +372,13 @@ int mkswap_main(int argc, char **argv) | |||
372 | unsigned short *q, sum; | 372 | unsigned short *q, sum; |
373 | 373 | ||
374 | if (read(DEV, buffer, 512) != 512) | 374 | if (read(DEV, buffer, 512) != 512) |
375 | error_msg_and_die("fatal: first page unreadable"); | 375 | bb_error_msg_and_die("fatal: first page unreadable"); |
376 | if (buffer[508] == 0xDA && buffer[509] == 0xBE) { | 376 | if (buffer[508] == 0xDA && buffer[509] == 0xBE) { |
377 | q = (unsigned short *) (buffer + 510); | 377 | q = (unsigned short *) (buffer + 510); |
378 | for (sum = 0; q >= (unsigned short *) buffer;) | 378 | for (sum = 0; q >= (unsigned short *) buffer;) |
379 | sum ^= *q--; | 379 | sum ^= *q--; |
380 | if (!sum) { | 380 | if (!sum) { |
381 | error_msg("Device '%s' contains a valid Sun disklabel.\n" | 381 | bb_error_msg("Device '%s' contains a valid Sun disklabel.\n" |
382 | "This probably means creating v0 swap would destroy your partition table\n" | 382 | "This probably means creating v0 swap would destroy your partition table\n" |
383 | "No swap created. If you really want to create swap v0 on that device, use\n" | 383 | "No swap created. If you really want to create swap v0 on that device, use\n" |
384 | "the -f option to force it.", device_name); | 384 | "the -f option to force it.", device_name); |
@@ -391,7 +391,7 @@ int mkswap_main(int argc, char **argv) | |||
391 | if (version == 0 || check) | 391 | if (version == 0 || check) |
392 | check_blocks(); | 392 | check_blocks(); |
393 | if (version == 0 && !bit_test_and_clear(signature_page, 0)) | 393 | if (version == 0 && !bit_test_and_clear(signature_page, 0)) |
394 | error_msg_and_die("fatal: first page unreadable"); | 394 | bb_error_msg_and_die("fatal: first page unreadable"); |
395 | if (version == 1) { | 395 | if (version == 1) { |
396 | p->version = version; | 396 | p->version = version; |
397 | p->last_page = PAGES - 1; | 397 | p->last_page = PAGES - 1; |
@@ -400,23 +400,23 @@ int mkswap_main(int argc, char **argv) | |||
400 | 400 | ||
401 | goodpages = PAGES - badpages - 1; | 401 | goodpages = PAGES - badpages - 1; |
402 | if (goodpages <= 0) | 402 | if (goodpages <= 0) |
403 | error_msg_and_die("Unable to set up swap-space: unreadable"); | 403 | bb_error_msg_and_die("Unable to set up swap-space: unreadable"); |
404 | printf("Setting up swapspace version %d, size = %ld bytes\n", | 404 | printf("Setting up swapspace version %d, size = %ld bytes\n", |
405 | version, (long) (goodpages * pagesize)); | 405 | version, (long) (goodpages * pagesize)); |
406 | write_signature((version == 0) ? "SWAP-SPACE" : "SWAPSPACE2"); | 406 | write_signature((version == 0) ? "SWAP-SPACE" : "SWAPSPACE2"); |
407 | 407 | ||
408 | offset = ((version == 0) ? 0 : 1024); | 408 | offset = ((version == 0) ? 0 : 1024); |
409 | if (lseek(DEV, offset, SEEK_SET) != offset) | 409 | if (lseek(DEV, offset, SEEK_SET) != offset) |
410 | error_msg_and_die("unable to rewind swap-device"); | 410 | bb_error_msg_and_die("unable to rewind swap-device"); |
411 | if (write(DEV, (char *) signature_page + offset, pagesize - offset) | 411 | if (write(DEV, (char *) signature_page + offset, pagesize - offset) |
412 | != pagesize - offset) | 412 | != pagesize - offset) |
413 | error_msg_and_die("unable to write signature page"); | 413 | bb_error_msg_and_die("unable to write signature page"); |
414 | 414 | ||
415 | /* | 415 | /* |
416 | * A subsequent swapon() will fail if the signature | 416 | * A subsequent swapon() will fail if the signature |
417 | * is not actually on disk. (This is a kernel bug.) | 417 | * is not actually on disk. (This is a kernel bug.) |
418 | */ | 418 | */ |
419 | if (fsync(DEV)) | 419 | if (fsync(DEV)) |
420 | error_msg_and_die("fsync failed"); | 420 | bb_error_msg_and_die("fsync failed"); |
421 | return EXIT_SUCCESS; | 421 | return EXIT_SUCCESS; |
422 | } | 422 | } |
diff --git a/util-linux/more.c b/util-linux/more.c index c26e4fe54..ff0557d22 100644 --- a/util-linux/more.c +++ b/util-linux/more.c | |||
@@ -81,7 +81,7 @@ extern int more_main(int argc, char **argv) | |||
81 | if(isatty(fileno(stdout))) { | 81 | if(isatty(fileno(stdout))) { |
82 | cin = fopen(CURRENT_TTY, "r"); | 82 | cin = fopen(CURRENT_TTY, "r"); |
83 | if (!cin) | 83 | if (!cin) |
84 | cin = xfopen(CONSOLE_DEV, "r"); | 84 | cin = bb_xfopen(CONSOLE_DEV, "r"); |
85 | please_display_more_prompt = 0; | 85 | please_display_more_prompt = 0; |
86 | #ifdef CONFIG_FEATURE_USE_TERMIOS | 86 | #ifdef CONFIG_FEATURE_USE_TERMIOS |
87 | getTermSettings(fileno(cin), &initial_settings); | 87 | getTermSettings(fileno(cin), &initial_settings); |
@@ -105,7 +105,7 @@ extern int more_main(int argc, char **argv) | |||
105 | if (argc == 0) { | 105 | if (argc == 0) { |
106 | file = stdin; | 106 | file = stdin; |
107 | } else | 107 | } else |
108 | file = wfopen(*argv, "r"); | 108 | file = bb_wfopen(*argv, "r"); |
109 | if(file==0) | 109 | if(file==0) |
110 | goto loop; | 110 | goto loop; |
111 | 111 | ||
diff --git a/util-linux/mount.c b/util-linux/mount.c index b3e945ce3..d02005600 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
@@ -86,8 +86,6 @@ extern int umount2(__const char *__special_file, int __flags); | |||
86 | 86 | ||
87 | extern int sysfs(int option, unsigned int fs_index, char *buf); | 87 | extern int sysfs(int option, unsigned int fs_index, char *buf); |
88 | 88 | ||
89 | extern const char mtab_file[]; /* Defined in utility.c */ | ||
90 | |||
91 | struct mount_options { | 89 | struct mount_options { |
92 | const char *name; | 90 | const char *name; |
93 | unsigned long and; | 91 | unsigned long and; |
@@ -136,20 +134,20 @@ do_mount(char *specialfile, char *dir, char *filesystemtype, long flags, | |||
136 | 134 | ||
137 | specialfile = find_unused_loop_device(); | 135 | specialfile = find_unused_loop_device(); |
138 | if (specialfile == NULL) { | 136 | if (specialfile == NULL) { |
139 | error_msg_and_die("Could not find a spare loop device"); | 137 | bb_error_msg_and_die("Could not find a spare loop device"); |
140 | } | 138 | } |
141 | if (set_loop(specialfile, lofile, 0, &loro)) { | 139 | if (set_loop(specialfile, lofile, 0, &loro)) { |
142 | error_msg_and_die("Could not setup loop device"); | 140 | bb_error_msg_and_die("Could not setup loop device"); |
143 | } | 141 | } |
144 | if (!(flags & MS_RDONLY) && loro) { /* loop is ro, but wanted rw */ | 142 | if (!(flags & MS_RDONLY) && loro) { /* loop is ro, but wanted rw */ |
145 | error_msg("WARNING: loop device is read-only"); | 143 | bb_error_msg("WARNING: loop device is read-only"); |
146 | flags |= MS_RDONLY; | 144 | flags |= MS_RDONLY; |
147 | } | 145 | } |
148 | } | 146 | } |
149 | #endif | 147 | #endif |
150 | status = mount(specialfile, dir, filesystemtype, flags, string_flags); | 148 | status = mount(specialfile, dir, filesystemtype, flags, string_flags); |
151 | if (status < 0 && errno == EROFS) { | 149 | if (status < 0 && errno == EROFS) { |
152 | error_msg("%s is write-protected, mounting read-only", | 150 | bb_error_msg("%s is write-protected, mounting read-only", |
153 | specialfile); | 151 | specialfile); |
154 | status = mount(specialfile, dir, filesystemtype, flags |= | 152 | status = mount(specialfile, dir, filesystemtype, flags |= |
155 | MS_RDONLY, string_flags); | 153 | MS_RDONLY, string_flags); |
@@ -181,7 +179,7 @@ do_mount(char *specialfile, char *dir, char *filesystemtype, long flags, | |||
181 | #endif | 179 | #endif |
182 | 180 | ||
183 | if (errno == EPERM) { | 181 | if (errno == EPERM) { |
184 | error_msg_and_die("permission denied. Are you root?"); | 182 | bb_error_msg_and_die(bb_msg_perm_denied_are_you_root); |
185 | } | 183 | } |
186 | 184 | ||
187 | return (FALSE); | 185 | return (FALSE); |
@@ -268,7 +266,7 @@ static int mount_one(char *blockDevice, char *directory, char *filesystemType, | |||
268 | 266 | ||
269 | filesystemType = buf; | 267 | filesystemType = buf; |
270 | 268 | ||
271 | if (xstrlen(filesystemType)) { | 269 | if (bb_strlen(filesystemType)) { |
272 | status = | 270 | status = |
273 | do_mount(blockDevice, directory, filesystemType, | 271 | do_mount(blockDevice, directory, filesystemType, |
274 | flags | MS_MGC_VAL, string_flags, | 272 | flags | MS_MGC_VAL, string_flags, |
@@ -284,7 +282,7 @@ static int mount_one(char *blockDevice, char *directory, char *filesystemType, | |||
284 | } | 282 | } |
285 | 283 | ||
286 | if ((!f || read_proc) && !status) { | 284 | if ((!f || read_proc) && !status) { |
287 | f = xfopen("/proc/filesystems", "r"); | 285 | f = bb_xfopen("/proc/filesystems", "r"); |
288 | 286 | ||
289 | while (fgets(buf, sizeof(buf), f) != NULL) { | 287 | while (fgets(buf, sizeof(buf), f) != NULL) { |
290 | filesystemType = buf; | 288 | filesystemType = buf; |
@@ -319,7 +317,7 @@ static int mount_one(char *blockDevice, char *directory, char *filesystemType, | |||
319 | 317 | ||
320 | if (!status) { | 318 | if (!status) { |
321 | if (whineOnErrors) { | 319 | if (whineOnErrors) { |
322 | perror_msg("Mounting %s on %s failed", blockDevice, directory); | 320 | bb_perror_msg("Mounting %s on %s failed", blockDevice, directory); |
323 | } | 321 | } |
324 | return (FALSE); | 322 | return (FALSE); |
325 | } | 323 | } |
@@ -328,7 +326,7 @@ static int mount_one(char *blockDevice, char *directory, char *filesystemType, | |||
328 | 326 | ||
329 | static void show_mounts(char *onlytype) | 327 | static void show_mounts(char *onlytype) |
330 | { | 328 | { |
331 | FILE *mountTable = setmntent(mtab_file, "r"); | 329 | FILE *mountTable = setmntent(bb_path_mtab_file, "r"); |
332 | 330 | ||
333 | if (mountTable) { | 331 | if (mountTable) { |
334 | struct mntent *m; | 332 | struct mntent *m; |
@@ -351,7 +349,7 @@ static void show_mounts(char *onlytype) | |||
351 | } | 349 | } |
352 | endmntent(mountTable); | 350 | endmntent(mountTable); |
353 | } else { | 351 | } else { |
354 | perror_msg_and_die("%s", mtab_file); | 352 | bb_perror_msg_and_die(bb_path_mtab_file); |
355 | } | 353 | } |
356 | exit(EXIT_SUCCESS); | 354 | exit(EXIT_SUCCESS); |
357 | } | 355 | } |
@@ -359,7 +357,7 @@ static void show_mounts(char *onlytype) | |||
359 | extern int mount_main(int argc, char **argv) | 357 | extern int mount_main(int argc, char **argv) |
360 | { | 358 | { |
361 | struct stat statbuf; | 359 | struct stat statbuf; |
362 | char *string_flags = xstrdup(""); | 360 | char *string_flags = bb_xstrdup(""); |
363 | char *extra_opts; | 361 | char *extra_opts; |
364 | int flags = 0; | 362 | int flags = 0; |
365 | char *filesystemType = "auto"; | 363 | char *filesystemType = "auto"; |
@@ -413,7 +411,7 @@ extern int mount_main(int argc, char **argv) | |||
413 | if (optind < argc) { | 411 | if (optind < argc) { |
414 | /* if device is a filename get its real path */ | 412 | /* if device is a filename get its real path */ |
415 | if (stat(argv[optind], &statbuf) == 0) { | 413 | if (stat(argv[optind], &statbuf) == 0) { |
416 | char *tmp = simplify_path(argv[optind]); | 414 | char *tmp = bb_simplify_path(argv[optind]); |
417 | 415 | ||
418 | safe_strncpy(device, tmp, PATH_MAX); | 416 | safe_strncpy(device, tmp, PATH_MAX); |
419 | } else { | 417 | } else { |
@@ -422,13 +420,13 @@ extern int mount_main(int argc, char **argv) | |||
422 | } | 420 | } |
423 | 421 | ||
424 | if (optind + 1 < argc) | 422 | if (optind + 1 < argc) |
425 | directory = simplify_path(argv[optind + 1]); | 423 | directory = bb_simplify_path(argv[optind + 1]); |
426 | 424 | ||
427 | if (all || optind + 1 == argc) { | 425 | if (all || optind + 1 == argc) { |
428 | f = setmntent("/etc/fstab", "r"); | 426 | f = setmntent("/etc/fstab", "r"); |
429 | 427 | ||
430 | if (f == NULL) | 428 | if (f == NULL) |
431 | perror_msg_and_die("\nCannot read /etc/fstab"); | 429 | bb_perror_msg_and_die("\nCannot read /etc/fstab"); |
432 | 430 | ||
433 | while ((m = getmntent(f)) != NULL) { | 431 | while ((m = getmntent(f)) != NULL) { |
434 | if (!all && (optind + 1 == argc) | 432 | if (!all && (optind + 1 == argc) |
@@ -452,7 +450,7 @@ extern int mount_main(int argc, char **argv) | |||
452 | 450 | ||
453 | strcpy(device, m->mnt_fsname); | 451 | strcpy(device, m->mnt_fsname); |
454 | strcpy(directory, m->mnt_dir); | 452 | strcpy(directory, m->mnt_dir); |
455 | filesystemType = xstrdup(m->mnt_type); | 453 | filesystemType = bb_xstrdup(m->mnt_type); |
456 | singlemount: | 454 | singlemount: |
457 | extra_opts = string_flags; | 455 | extra_opts = string_flags; |
458 | rc = EXIT_SUCCESS; | 456 | rc = EXIT_SUCCESS; |
@@ -462,7 +460,7 @@ extern int mount_main(int argc, char **argv) | |||
462 | if (nfsmount | 460 | if (nfsmount |
463 | (device, directory, &flags, &extra_opts, &string_flags, | 461 | (device, directory, &flags, &extra_opts, &string_flags, |
464 | 1)) { | 462 | 1)) { |
465 | perror_msg("nfsmount failed"); | 463 | bb_perror_msg("nfsmount failed"); |
466 | rc = EXIT_FAILURE; | 464 | rc = EXIT_FAILURE; |
467 | } | 465 | } |
468 | } | 466 | } |
diff --git a/util-linux/nfsmount.c b/util-linux/nfsmount.c index ba14aa6bc..0edfdf34a 100644 --- a/util-linux/nfsmount.c +++ b/util-linux/nfsmount.c | |||
@@ -357,7 +357,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
357 | msock = fsock = -1; | 357 | msock = fsock = -1; |
358 | mclient = NULL; | 358 | mclient = NULL; |
359 | if (strlen(spec) >= sizeof(hostdir)) { | 359 | if (strlen(spec) >= sizeof(hostdir)) { |
360 | error_msg("excessively long host:dir argument"); | 360 | bb_error_msg("excessively long host:dir argument"); |
361 | goto fail; | 361 | goto fail; |
362 | } | 362 | } |
363 | strcpy(hostdir, spec); | 363 | strcpy(hostdir, spec); |
@@ -369,10 +369,10 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
369 | until they can be fully supported. (mack@sgi.com) */ | 369 | until they can be fully supported. (mack@sgi.com) */ |
370 | if ((s = strchr(hostdir, ','))) { | 370 | if ((s = strchr(hostdir, ','))) { |
371 | *s = '\0'; | 371 | *s = '\0'; |
372 | error_msg("warning: multiple hostnames not supported"); | 372 | bb_error_msg("warning: multiple hostnames not supported"); |
373 | } | 373 | } |
374 | } else { | 374 | } else { |
375 | error_msg("directory to mount not in host:dir format"); | 375 | bb_error_msg("directory to mount not in host:dir format"); |
376 | goto fail; | 376 | goto fail; |
377 | } | 377 | } |
378 | 378 | ||
@@ -382,11 +382,11 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
382 | #endif | 382 | #endif |
383 | { | 383 | { |
384 | if ((hp = gethostbyname(hostname)) == NULL) { | 384 | if ((hp = gethostbyname(hostname)) == NULL) { |
385 | herror_msg("%s", hostname); | 385 | bb_herror_msg("%s", hostname); |
386 | goto fail; | 386 | goto fail; |
387 | } else { | 387 | } else { |
388 | if (hp->h_length > sizeof(struct in_addr)) { | 388 | if (hp->h_length > sizeof(struct in_addr)) { |
389 | error_msg("got bad hp->h_length"); | 389 | bb_error_msg("got bad hp->h_length"); |
390 | hp->h_length = sizeof(struct in_addr); | 390 | hp->h_length = sizeof(struct in_addr); |
391 | } | 391 | } |
392 | memcpy(&server_addr.sin_addr, | 392 | memcpy(&server_addr.sin_addr, |
@@ -403,12 +403,12 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
403 | if (!old_opts) | 403 | if (!old_opts) |
404 | old_opts = ""; | 404 | old_opts = ""; |
405 | if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) { | 405 | if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) { |
406 | error_msg("excessively long option argument"); | 406 | bb_error_msg("excessively long option argument"); |
407 | goto fail; | 407 | goto fail; |
408 | } | 408 | } |
409 | sprintf(new_opts, "%s%saddr=%s", | 409 | sprintf(new_opts, "%s%saddr=%s", |
410 | old_opts, *old_opts ? "," : "", s); | 410 | old_opts, *old_opts ? "," : "", s); |
411 | *extra_opts = xstrdup(new_opts); | 411 | *extra_opts = bb_xstrdup(new_opts); |
412 | 412 | ||
413 | /* Set default options. | 413 | /* Set default options. |
414 | * rsize/wsize (and bsize, for ver >= 3) are left 0 in order to | 414 | * rsize/wsize (and bsize, for ver >= 3) are left 0 in order to |
@@ -476,7 +476,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
476 | else if (!strcmp(opt, "mountport")) | 476 | else if (!strcmp(opt, "mountport")) |
477 | mountport = val; | 477 | mountport = val; |
478 | else if (!strcmp(opt, "mounthost")) | 478 | else if (!strcmp(opt, "mounthost")) |
479 | mounthost=xstrndup(opteq+1, | 479 | mounthost=bb_xstrndup(opteq+1, |
480 | strcspn(opteq+1," \t\n\r,")); | 480 | strcspn(opteq+1," \t\n\r,")); |
481 | else if (!strcmp(opt, "mountprog")) | 481 | else if (!strcmp(opt, "mountprog")) |
482 | mountprog = val; | 482 | mountprog = val; |
@@ -563,11 +563,11 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
563 | data.flags |= (nolock ? NFS_MOUNT_NONLM : 0); | 563 | data.flags |= (nolock ? NFS_MOUNT_NONLM : 0); |
564 | #endif | 564 | #endif |
565 | if (nfsvers > MAX_NFSPROT) { | 565 | if (nfsvers > MAX_NFSPROT) { |
566 | error_msg("NFSv%d not supported!", nfsvers); | 566 | bb_error_msg("NFSv%d not supported!", nfsvers); |
567 | return 0; | 567 | return 0; |
568 | } | 568 | } |
569 | if (mountvers > MAX_NFSPROT) { | 569 | if (mountvers > MAX_NFSPROT) { |
570 | error_msg("NFSv%d not supported!", nfsvers); | 570 | bb_error_msg("NFSv%d not supported!", nfsvers); |
571 | return 0; | 571 | return 0; |
572 | } | 572 | } |
573 | if (nfsvers && !mountvers) | 573 | if (nfsvers && !mountvers) |
@@ -627,11 +627,11 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
627 | mount_server_addr.sin_addr.s_addr = inet_addr(hostname); | 627 | mount_server_addr.sin_addr.s_addr = inet_addr(hostname); |
628 | } else { | 628 | } else { |
629 | if ((hp = gethostbyname(mounthost)) == NULL) { | 629 | if ((hp = gethostbyname(mounthost)) == NULL) { |
630 | herror_msg("%s", mounthost); | 630 | bb_herror_msg("%s", mounthost); |
631 | goto fail; | 631 | goto fail; |
632 | } else { | 632 | } else { |
633 | if (hp->h_length > sizeof(struct in_addr)) { | 633 | if (hp->h_length > sizeof(struct in_addr)) { |
634 | error_msg("got bad hp->h_length?"); | 634 | bb_error_msg("got bad hp->h_length?"); |
635 | hp->h_length = sizeof(struct in_addr); | 635 | hp->h_length = sizeof(struct in_addr); |
636 | } | 636 | } |
637 | mount_server_addr.sin_family = AF_INET; | 637 | mount_server_addr.sin_family = AF_INET; |
@@ -753,7 +753,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
753 | if (!bg) | 753 | if (!bg) |
754 | goto fail; | 754 | goto fail; |
755 | if (!running_bg) { | 755 | if (!running_bg) { |
756 | prev_bg_host = xstrdup(hostname); | 756 | prev_bg_host = bb_xstrdup(hostname); |
757 | if (retry > 0) | 757 | if (retry > 0) |
758 | retval = EX_BG; | 758 | retval = EX_BG; |
759 | goto fail; | 759 | goto fail; |
@@ -766,7 +766,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
766 | 766 | ||
767 | if (nfsvers == 2) { | 767 | if (nfsvers == 2) { |
768 | if (status.nfsv2.fhs_status != 0) { | 768 | if (status.nfsv2.fhs_status != 0) { |
769 | error_msg("%s:%s failed, reason given by server: %s", | 769 | bb_error_msg("%s:%s failed, reason given by server: %s", |
770 | hostname, pathname, | 770 | hostname, pathname, |
771 | nfs_strerror(status.nfsv2.fhs_status)); | 771 | nfs_strerror(status.nfsv2.fhs_status)); |
772 | goto fail; | 772 | goto fail; |
@@ -784,7 +784,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
784 | #if NFS_MOUNT_VERSION >= 4 | 784 | #if NFS_MOUNT_VERSION >= 4 |
785 | fhandle3 *my_fhandle; | 785 | fhandle3 *my_fhandle; |
786 | if (status.nfsv3.fhs_status != 0) { | 786 | if (status.nfsv3.fhs_status != 0) { |
787 | error_msg("%s:%s failed, reason given by server: %s", | 787 | bb_error_msg("%s:%s failed, reason given by server: %s", |
788 | hostname, pathname, | 788 | hostname, pathname, |
789 | nfs_strerror(status.nfsv3.fhs_status)); | 789 | nfs_strerror(status.nfsv3.fhs_status)); |
790 | goto fail; | 790 | goto fail; |
diff --git a/util-linux/pivot_root.c b/util-linux/pivot_root.c index ba26b9c58..39453a261 100644 --- a/util-linux/pivot_root.c +++ b/util-linux/pivot_root.c | |||
@@ -16,10 +16,10 @@ extern int pivot_root(const char * new_root,const char * put_old); | |||
16 | int pivot_root_main(int argc, char **argv) | 16 | int pivot_root_main(int argc, char **argv) |
17 | { | 17 | { |
18 | if (argc != 3) | 18 | if (argc != 3) |
19 | show_usage(); | 19 | bb_show_usage(); |
20 | 20 | ||
21 | if (pivot_root(argv[1],argv[2]) < 0) | 21 | if (pivot_root(argv[1],argv[2]) < 0) |
22 | perror_msg_and_die("pivot_root"); | 22 | bb_perror_msg_and_die("pivot_root"); |
23 | 23 | ||
24 | return EXIT_SUCCESS; | 24 | return EXIT_SUCCESS; |
25 | 25 | ||
diff --git a/util-linux/rdate.c b/util-linux/rdate.c index df7d7bbc4..3c3b152a2 100644 --- a/util-linux/rdate.c +++ b/util-linux/rdate.c | |||
@@ -49,7 +49,7 @@ static time_t askremotedate(const char *host) | |||
49 | fd = xconnect(host, port); | 49 | fd = xconnect(host, port); |
50 | 50 | ||
51 | if (read(fd, (void *)&nett, 4) != 4) /* read time from server */ | 51 | if (read(fd, (void *)&nett, 4) != 4) /* read time from server */ |
52 | error_msg_and_die("%s did not send the complete time", host); | 52 | bb_error_msg_and_die("%s did not send the complete time", host); |
53 | 53 | ||
54 | close(fd); | 54 | close(fd); |
55 | 55 | ||
@@ -83,18 +83,18 @@ int rdate_main(int argc, char **argv) | |||
83 | setdate = 0; | 83 | setdate = 0; |
84 | break; | 84 | break; |
85 | default: | 85 | default: |
86 | show_usage(); | 86 | bb_show_usage(); |
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | if (optind == argc) | 90 | if (optind == argc) |
91 | show_usage(); | 91 | bb_show_usage(); |
92 | 92 | ||
93 | remote_time = askremotedate(argv[optind]); | 93 | remote_time = askremotedate(argv[optind]); |
94 | 94 | ||
95 | if (setdate) { | 95 | if (setdate) { |
96 | if (stime(&remote_time) < 0) | 96 | if (stime(&remote_time) < 0) |
97 | perror_msg_and_die("Could not set time of day"); | 97 | bb_perror_msg_and_die("Could not set time of day"); |
98 | } | 98 | } |
99 | 99 | ||
100 | if (printdate) | 100 | if (printdate) |
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c index 918a5bc0e..b323cb10a 100644 --- a/util-linux/swaponoff.c +++ b/util-linux/swaponoff.c | |||
@@ -51,13 +51,13 @@ static int swap_enable_disable(const char *device) | |||
51 | struct stat st; | 51 | struct stat st; |
52 | 52 | ||
53 | if (stat(device, &st) < 0) { | 53 | if (stat(device, &st) < 0) { |
54 | perror_msg_and_die("cannot stat %s"); | 54 | bb_perror_msg_and_die("cannot stat %s", device); |
55 | } | 55 | } |
56 | 56 | ||
57 | /* test for holes */ | 57 | /* test for holes */ |
58 | if (S_ISREG(st.st_mode)) { | 58 | if (S_ISREG(st.st_mode)) { |
59 | if (st.st_blocks * 512 < st.st_size) { | 59 | if (st.st_blocks * 512 < st.st_size) { |
60 | error_msg_and_die("swap file has holes"); | 60 | bb_error_msg_and_die("swap file has holes"); |
61 | } | 61 | } |
62 | } | 62 | } |
63 | 63 | ||
@@ -67,7 +67,7 @@ static int swap_enable_disable(const char *device) | |||
67 | status = swapoff(device); | 67 | status = swapoff(device); |
68 | 68 | ||
69 | if (status != 0) { | 69 | if (status != 0) { |
70 | perror_msg("%s", device); | 70 | bb_perror_msg("%s", device); |
71 | return EXIT_FAILURE; | 71 | return EXIT_FAILURE; |
72 | } | 72 | } |
73 | return EXIT_SUCCESS; | 73 | return EXIT_SUCCESS; |
@@ -80,7 +80,7 @@ static int do_em_all(void) | |||
80 | int err = 0; | 80 | int err = 0; |
81 | 81 | ||
82 | if (f == NULL) | 82 | if (f == NULL) |
83 | perror_msg_and_die("/etc/fstab"); | 83 | bb_perror_msg_and_die("/etc/fstab"); |
84 | while ((m = getmntent(f)) != NULL) { | 84 | while ((m = getmntent(f)) != NULL) { |
85 | if (strcmp(m->mnt_type, MNTTYPE_SWAP)==0) { | 85 | if (strcmp(m->mnt_type, MNTTYPE_SWAP)==0) { |
86 | if(swap_enable_disable(m->mnt_fsname) == EXIT_FAILURE) | 86 | if(swap_enable_disable(m->mnt_fsname) == EXIT_FAILURE) |
@@ -94,7 +94,7 @@ static int do_em_all(void) | |||
94 | 94 | ||
95 | extern int swap_on_off_main(int argc, char **argv) | 95 | extern int swap_on_off_main(int argc, char **argv) |
96 | { | 96 | { |
97 | if (applet_name[5] == 'f') { /* "swapoff" */ | 97 | if (bb_applet_name[5] == 'f') { /* "swapoff" */ |
98 | whichApp = SWAPOFF_APP; | 98 | whichApp = SWAPOFF_APP; |
99 | } | 99 | } |
100 | 100 | ||
@@ -113,7 +113,7 @@ extern int swap_on_off_main(int argc, char **argv) | |||
113 | struct stat statBuf; | 113 | struct stat statBuf; |
114 | 114 | ||
115 | if (stat("/etc/fstab", &statBuf) < 0) | 115 | if (stat("/etc/fstab", &statBuf) < 0) |
116 | error_msg_and_die("/etc/fstab file missing"); | 116 | bb_error_msg_and_die("/etc/fstab file missing"); |
117 | } | 117 | } |
118 | return do_em_all(); | 118 | return do_em_all(); |
119 | break; | 119 | break; |
@@ -124,5 +124,5 @@ extern int swap_on_off_main(int argc, char **argv) | |||
124 | return swap_enable_disable(*argv); | 124 | return swap_enable_disable(*argv); |
125 | 125 | ||
126 | usage_and_exit: | 126 | usage_and_exit: |
127 | show_usage(); | 127 | bb_show_usage(); |
128 | } | 128 | } |
diff --git a/util-linux/umount.c b/util-linux/umount.c index 391d245a8..1d3e89301 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c | |||
@@ -67,7 +67,6 @@ static int useMtab = TRUE; | |||
67 | #endif | 67 | #endif |
68 | static int umountAll = FALSE; | 68 | static int umountAll = FALSE; |
69 | static int doRemount = FALSE; | 69 | static int doRemount = FALSE; |
70 | extern const char mtab_file[]; /* Defined in utility.c */ | ||
71 | 70 | ||
72 | 71 | ||
73 | 72 | ||
@@ -87,8 +86,8 @@ static void mtab_read(void) | |||
87 | if (mtab_cache != NULL) | 86 | if (mtab_cache != NULL) |
88 | return; | 87 | return; |
89 | 88 | ||
90 | if ((fp = setmntent(mtab_file, "r")) == NULL) { | 89 | if ((fp = setmntent(bb_path_mtab_file, "r")) == NULL) { |
91 | error_msg("Cannot open %s", mtab_file); | 90 | bb_error_msg("Cannot open %s", bb_path_mtab_file); |
92 | return; | 91 | return; |
93 | } | 92 | } |
94 | while ((e = getmntent(fp))) { | 93 | while ((e = getmntent(fp))) { |
@@ -185,7 +184,7 @@ static int do_umount(const char *name) | |||
185 | if (status != 0 && doForce) { | 184 | if (status != 0 && doForce) { |
186 | status = umount2(blockDevice, MNT_FORCE); | 185 | status = umount2(blockDevice, MNT_FORCE); |
187 | if (status != 0) { | 186 | if (status != 0) { |
188 | error_msg_and_die("forced umount of %s failed!", blockDevice); | 187 | bb_error_msg_and_die("forced umount of %s failed!", blockDevice); |
189 | } | 188 | } |
190 | } | 189 | } |
191 | #endif | 190 | #endif |
@@ -193,9 +192,9 @@ static int do_umount(const char *name) | |||
193 | status = mount(blockDevice, name, NULL, | 192 | status = mount(blockDevice, name, NULL, |
194 | MS_MGC_VAL | MS_REMOUNT | MS_RDONLY, NULL); | 193 | MS_MGC_VAL | MS_REMOUNT | MS_RDONLY, NULL); |
195 | if (status == 0) { | 194 | if (status == 0) { |
196 | error_msg("%s busy - remounted read-only", blockDevice); | 195 | bb_error_msg("%s busy - remounted read-only", blockDevice); |
197 | } else { | 196 | } else { |
198 | error_msg("Cannot remount %s read-only", blockDevice); | 197 | bb_error_msg("Cannot remount %s read-only", blockDevice); |
199 | } | 198 | } |
200 | } | 199 | } |
201 | if (status == 0) { | 200 | if (status == 0) { |
@@ -221,7 +220,7 @@ static int umount_all(void) | |||
221 | if (!do_umount(mountpt)) { | 220 | if (!do_umount(mountpt)) { |
222 | /* Don't bother retrying the umount on busy devices */ | 221 | /* Don't bother retrying the umount on busy devices */ |
223 | if (errno == EBUSY) { | 222 | if (errno == EBUSY) { |
224 | perror_msg("%s", mountpt); | 223 | bb_perror_msg("%s", mountpt); |
225 | status = FALSE; | 224 | status = FALSE; |
226 | continue; | 225 | continue; |
227 | } | 226 | } |
@@ -241,7 +240,7 @@ extern int umount_main(int argc, char **argv) | |||
241 | char path[PATH_MAX]; | 240 | char path[PATH_MAX]; |
242 | 241 | ||
243 | if (argc < 2) { | 242 | if (argc < 2) { |
244 | show_usage(); | 243 | bb_show_usage(); |
245 | } | 244 | } |
246 | #ifdef CONFIG_FEATURE_CLEAN_UP | 245 | #ifdef CONFIG_FEATURE_CLEAN_UP |
247 | atexit(mtab_free); | 246 | atexit(mtab_free); |
@@ -275,7 +274,7 @@ extern int umount_main(int argc, char **argv) | |||
275 | case 'v': | 274 | case 'v': |
276 | break; /* ignore -v */ | 275 | break; /* ignore -v */ |
277 | default: | 276 | default: |
278 | show_usage(); | 277 | bb_show_usage(); |
279 | } | 278 | } |
280 | } | 279 | } |
281 | 280 | ||
@@ -287,9 +286,9 @@ extern int umount_main(int argc, char **argv) | |||
287 | return EXIT_FAILURE; | 286 | return EXIT_FAILURE; |
288 | } | 287 | } |
289 | if (realpath(*argv, path) == NULL) | 288 | if (realpath(*argv, path) == NULL) |
290 | perror_msg_and_die("%s", path); | 289 | bb_perror_msg_and_die("%s", path); |
291 | if (do_umount(path)) | 290 | if (do_umount(path)) |
292 | return EXIT_SUCCESS; | 291 | return EXIT_SUCCESS; |
293 | perror_msg_and_die("%s", *argv); | 292 | bb_perror_msg_and_die("%s", *argv); |
294 | } | 293 | } |
295 | 294 | ||