aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2016-07-07 14:28:08 +0100
committerRon Yorston <rmy@pobox.com>2016-07-07 14:58:55 +0100
commit613f46218c53c8cabdbf0435653e74e0e0e91e1c (patch)
treeca06a7e7a3e4c861441acb4ea20648d7827fa6ae /util-linux
parenta0c61c9492723dd31681f878f9c68c92817a476d (diff)
parent237bedd499c58034a1355484d6d4d906f0180308 (diff)
downloadbusybox-w32-613f46218c53c8cabdbf0435653e74e0e0e91e1c.tar.gz
busybox-w32-613f46218c53c8cabdbf0435653e74e0e0e91e1c.tar.bz2
busybox-w32-613f46218c53c8cabdbf0435653e74e0e0e91e1c.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/dmesg.c3
-rw-r--r--util-linux/fbset.c5
-rw-r--r--util-linux/fdisk.c3
-rw-r--r--util-linux/fdisk_osf.c3
-rw-r--r--util-linux/fdisk_sgi.c27
-rw-r--r--util-linux/getopt.c3
-rw-r--r--util-linux/mkfs_ext2.c3
-rw-r--r--util-linux/mkfs_minix.c3
-rw-r--r--util-linux/mkfs_reiser.c4
-rw-r--r--util-linux/mount.c6
-rw-r--r--util-linux/readprofile.c3
11 files changed, 31 insertions, 32 deletions
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c
index e543446c1..50e8a0fce 100644
--- a/util-linux/dmesg.c
+++ b/util-linux/dmesg.c
@@ -34,8 +34,7 @@ int dmesg_main(int argc UNUSED_PARAM, char **argv)
34 OPT_r = 1 << 3 34 OPT_r = 1 << 3
35 }; 35 };
36 36
37 opt_complementary = "s+:n+"; /* numeric */ 37 opts = getopt32(argv, "cs:+n:+r", &len, &level);
38 opts = getopt32(argv, "cs:n:r", &len, &level);
39 if (opts & OPT_n) { 38 if (opts & OPT_n) {
40 if (klogctl(8, NULL, (long) level)) 39 if (klogctl(8, NULL, (long) level))
41 bb_perror_msg_and_die("klogctl"); 40 bb_perror_msg_and_die("klogctl");
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 09e96b763..b75ec1921 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -164,6 +164,7 @@ static const struct cmdoptions_t {
164 const unsigned char code; 164 const unsigned char code;
165} g_cmdoptions[] = { 165} g_cmdoptions[] = {
166 /*"12345678" + NUL */ 166 /*"12345678" + NUL */
167//TODO: convert to index_in_strings()
167 { "fb" , 1, CMD_FB }, 168 { "fb" , 1, CMD_FB },
168 { "db" , 1, CMD_DB }, 169 { "db" , 1, CMD_DB },
169 { "a" , 0, CMD_ALL }, 170 { "a" , 0, CMD_ALL },
@@ -416,7 +417,7 @@ int fbset_main(int argc, char **argv)
416 unsigned options = 0; 417 unsigned options = 0;
417 418
418 const char *fbdev = DEFAULTFBDEV; 419 const char *fbdev = DEFAULTFBDEV;
419 const char *modefile = DEFAULTFBMODE; 420 IF_FEATURE_FBSET_READMODE(const char *modefile = DEFAULTFBMODE;)
420 char *thisarg; 421 char *thisarg;
421 char *mode = mode; /* for compiler */ 422 char *mode = mode; /* for compiler */
422 423
@@ -444,7 +445,7 @@ int fbset_main(int argc, char **argv)
444 fbdev = argv[1]; 445 fbdev = argv[1];
445 break; 446 break;
446 case CMD_DB: 447 case CMD_DB:
447 modefile = argv[1]; 448 IF_FEATURE_FBSET_READMODE(modefile = argv[1];)
448 break; 449 break;
449 case CMD_ALL: 450 case CMD_ALL:
450 options |= OPT_ALL; 451 options |= OPT_ALL;
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c
index f49ce95a4..6391f9bd9 100644
--- a/util-linux/fdisk.c
+++ b/util-linux/fdisk.c
@@ -2919,8 +2919,7 @@ int fdisk_main(int argc UNUSED_PARAM, char **argv)
2919 2919
2920 close_dev_fd(); /* needed: fd 3 must not stay closed */ 2920 close_dev_fd(); /* needed: fd 3 must not stay closed */
2921 2921
2922 opt_complementary = "b+:C+:H+:S+"; /* numeric params */ 2922 opt = getopt32(argv, "b:+C:+H:+lS:+u" IF_FEATURE_FDISK_BLKSIZE("s"),
2923 opt = getopt32(argv, "b:C:H:lS:u" IF_FEATURE_FDISK_BLKSIZE("s"),
2924 &sector_size, &user_cylinders, &user_heads, &user_sectors); 2923 &sector_size, &user_cylinders, &user_heads, &user_sectors);
2925 argv += optind; 2924 argv += optind;
2926 if (opt & OPT_b) { 2925 if (opt & OPT_b) {
diff --git a/util-linux/fdisk_osf.c b/util-linux/fdisk_osf.c
index af04cfcc8..89f1f323c 100644
--- a/util-linux/fdisk_osf.c
+++ b/util-linux/fdisk_osf.c
@@ -366,10 +366,11 @@ bsd_select(void)
366 } 366 }
367 printf("Reading disklabel of %s at sector %u\n", 367 printf("Reading disklabel of %s at sector %u\n",
368 partname(disk_device, t+1, 0), ss + BSD_LABELSECTOR); 368 partname(disk_device, t+1, 0), ss + BSD_LABELSECTOR);
369 if (xbsd_readlabel(xbsd_part) == 0) 369 if (xbsd_readlabel(xbsd_part) == 0) {
370 if (xbsd_create_disklabel() == 0) 370 if (xbsd_create_disklabel() == 0)
371 return; 371 return;
372 break; 372 break;
373 }
373 } 374 }
374 } 375 }
375 376
diff --git a/util-linux/fdisk_sgi.c b/util-linux/fdisk_sgi.c
index 23ebc56ef..30def09c6 100644
--- a/util-linux/fdisk_sgi.c
+++ b/util-linux/fdisk_sgi.c
@@ -504,17 +504,19 @@ verify_sgi(int verbose)
504 if (sgi_get_sysid(Index[0]) == SGI_ENTIRE_DISK) { 504 if (sgi_get_sysid(Index[0]) == SGI_ENTIRE_DISK) {
505 if ((Index[0] != 10) && verbose) 505 if ((Index[0] != 10) && verbose)
506 printf("IRIX likes when Partition 11 covers the entire disk\n"); 506 printf("IRIX likes when Partition 11 covers the entire disk\n");
507 if ((sgi_get_start_sector(Index[0]) != 0) && verbose) 507 if ((sgi_get_start_sector(Index[0]) != 0) && verbose) {
508 printf("The entire disk partition should start " 508 printf("The entire disk partition should start "
509 "at block 0,\n" 509 "at block 0,\n"
510 "not at diskblock %u\n", 510 "not at diskblock %u\n",
511 sgi_get_start_sector(Index[0])); 511 sgi_get_start_sector(Index[0]));
512 if (SGI_DEBUG) /* I do not understand how some disks fulfil it */ 512 }
513 if (SGI_DEBUG) { /* I do not understand how some disks fulfil it */
513 if ((sgi_get_num_sectors(Index[0]) != lastblock) && verbose) 514 if ((sgi_get_num_sectors(Index[0]) != lastblock) && verbose)
514 printf("The entire disk partition is only %u diskblock large,\n" 515 printf("The entire disk partition is only %u diskblock large,\n"
515 "but the disk is %u diskblocks long\n", 516 "but the disk is %u diskblocks long\n",
516 sgi_get_num_sectors(Index[0]), lastblock); 517 sgi_get_num_sectors(Index[0]), lastblock);
517 lastblock = sgi_get_num_sectors(Index[0]); 518 lastblock = sgi_get_num_sectors(Index[0]);
519 }
518 } else { 520 } else {
519 if (verbose) 521 if (verbose)
520 printf("One Partition (#11) should cover the entire disk\n"); 522 printf("One Partition (#11) should cover the entire disk\n");
@@ -669,16 +671,17 @@ sgi_set_volhdr(void)
669 int n; 671 int n;
670 672
671 for (n = 8; n < g_partitions; n++) { 673 for (n = 8; n < g_partitions; n++) {
672 if (!sgi_get_num_sectors(n)) { 674 if (!sgi_get_num_sectors(n)) {
673 /* 675 /*
674 * 5 cylinders is an arbitrary value I like 676 * 5 cylinders is an arbitrary value I like
675 * IRIX 5.3 stored files in the volume header 677 * IRIX 5.3 stored files in the volume header
676 * (like sash, symmon, fx, ide) with ca. 3200 678 * (like sash, symmon, fx, ide) with ca. 3200
677 * sectors. 679 * sectors.
678 */ 680 */
679 if (g_heads * g_sectors * 5 < sgi_get_lastblock()) 681 if (g_heads * g_sectors * 5 < sgi_get_lastblock()) {
680 sgi_set_partition(n, 0, g_heads * g_sectors * 5, SGI_VOLHDR); 682 sgi_set_partition(n, 0, g_heads * g_sectors * 5, SGI_VOLHDR);
681 break; 683 break;
684 }
682 } 685 }
683 } 686 }
684} 687}
diff --git a/util-linux/getopt.c b/util-linux/getopt.c
index b9dadf13c..18d490987 100644
--- a/util-linux/getopt.c
+++ b/util-linux/getopt.c
@@ -397,8 +397,7 @@ int getopt_main(int argc, char **argv)
397 opt = getopt32(argv, "+o:n:qQs:Tu", &optstr, &name, &s_arg); 397 opt = getopt32(argv, "+o:n:qQs:Tu", &optstr, &name, &s_arg);
398#else 398#else
399 applet_long_options = getopt_longopts; 399 applet_long_options = getopt_longopts;
400 opt_complementary = "l::"; 400 opt = getopt32(argv, "+o:n:qQs:Tual:*",
401 opt = getopt32(argv, "+o:n:qQs:Tual:",
402 &optstr, &name, &s_arg, &l_arg); 401 &optstr, &name, &s_arg, &l_arg);
403 /* Effectuate the read options for the applet itself */ 402 /* Effectuate the read options for the applet itself */
404 while (l_arg) { 403 while (l_arg) {
diff --git a/util-linux/mkfs_ext2.c b/util-linux/mkfs_ext2.c
index f91a0b4bf..413e7aa15 100644
--- a/util-linux/mkfs_ext2.c
+++ b/util-linux/mkfs_ext2.c
@@ -244,8 +244,7 @@ int mkfs_ext2_main(int argc UNUSED_PARAM, char **argv)
244 244
245 // using global "option_mask32" instead of local "opts": 245 // using global "option_mask32" instead of local "opts":
246 // we are register starved here 246 // we are register starved here
247 opt_complementary = "-1:b+:i+:I+:m+"; 247 /*opts =*/ getopt32(argv, "cl:b:+f:i:+I:+J:G:N:m:+o:g:L:M:O:r:E:T:U:jnqvFS",
248 /*opts =*/ getopt32(argv, "cl:b:f:i:I:J:G:N:m:o:g:L:M:O:r:E:T:U:jnqvFS",
249 /*lbfi:*/ NULL, &bs, NULL, &bpi, 248 /*lbfi:*/ NULL, &bs, NULL, &bpi,
250 /*IJGN:*/ &user_inodesize, NULL, NULL, NULL, 249 /*IJGN:*/ &user_inodesize, NULL, NULL, NULL,
251 /*mogL:*/ &reserved_percent, NULL, NULL, &label, 250 /*mogL:*/ &reserved_percent, NULL, NULL, &label,
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c
index 88d797584..aaabf8453 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -604,8 +604,7 @@ int mkfs_minix_main(int argc UNUSED_PARAM, char **argv)
604 bb_error_msg_and_die("bad inode size"); 604 bb_error_msg_and_die("bad inode size");
605#endif 605#endif
606 606
607 opt_complementary = "n+"; /* -n N */ 607 opt = getopt32(argv, "ci:l:n:+v", &str_i, &listfile, &G.namelen);
608 opt = getopt32(argv, "ci:l:n:v", &str_i, &listfile, &G.namelen);
609 argv += optind; 608 argv += optind;
610 //if (opt & 1) -c 609 //if (opt & 1) -c
611 if (opt & 2) G.req_nr_inodes = xatoul(str_i); // -i 610 if (opt & 2) G.req_nr_inodes = xatoul(str_i); // -i
diff --git a/util-linux/mkfs_reiser.c b/util-linux/mkfs_reiser.c
index 56c8f0ab5..0a31ee44f 100644
--- a/util-linux/mkfs_reiser.c
+++ b/util-linux/mkfs_reiser.c
@@ -169,8 +169,8 @@ int mkfs_reiser_main(int argc UNUSED_PARAM, char **argv)
169 169
170 // using global "option_mask32" instead of local "opts": 170 // using global "option_mask32" instead of local "opts":
171 // we are register starved here 171 // we are register starved here
172 opt_complementary = "-1:b+"; 172 opt_complementary = "-1";
173 /*opts =*/ getopt32(argv, "b:j:s:o:t:B:h:u:l:fqd", 173 /*opts =*/ getopt32(argv, "b:+j:s:o:t:B:h:u:l:fqd",
174 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &label); 174 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &label);
175 argv += optind; // argv[0] -- device 175 argv += optind; // argv[0] -- device
176 176
diff --git a/util-linux/mount.c b/util-linux/mount.c
index c76f6ef61..13590ceb4 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -268,7 +268,7 @@ enum {
268}; 268};
269 269
270 270
271#define OPTION_STR "o:t:rwanfvsiO:" IF_FEATURE_MOUNT_OTHERTAB("T:") 271#define OPTION_STR "o:*t:rwanfvsiO:" IF_FEATURE_MOUNT_OTHERTAB("T:")
272enum { 272enum {
273 OPT_o = (1 << 0), 273 OPT_o = (1 << 0),
274 OPT_t = (1 << 1), 274 OPT_t = (1 << 1),
@@ -2058,7 +2058,7 @@ static int singlemount(struct mntent *mp, int ignore_busy)
2058 del_loop(mp->mnt_fsname); 2058 del_loop(mp->mnt_fsname);
2059 if (ENABLE_FEATURE_CLEAN_UP) { 2059 if (ENABLE_FEATURE_CLEAN_UP) {
2060 free(loopFile); 2060 free(loopFile);
2061 free(mp->mnt_fsname); 2061 /* No, "rc != 0" needs it: free(mp->mnt_fsname); */
2062 } 2062 }
2063 } 2063 }
2064 2064
@@ -2167,7 +2167,7 @@ int mount_main(int argc UNUSED_PARAM, char **argv)
2167 2167
2168 // Parse remaining options 2168 // Parse remaining options
2169 // Max 2 params; -o is a list, -v is a counter 2169 // Max 2 params; -o is a list, -v is a counter
2170 opt_complementary = "?2o::" IF_FEATURE_MOUNT_VERBOSE("vv"); 2170 opt_complementary = "?2" IF_FEATURE_MOUNT_VERBOSE("vv");
2171 opt = getopt32(argv, OPTION_STR, &lst_o, &fstype, &O_optmatch 2171 opt = getopt32(argv, OPTION_STR, &lst_o, &fstype, &O_optmatch
2172 IF_FEATURE_MOUNT_OTHERTAB(, &fstabname) 2172 IF_FEATURE_MOUNT_OTHERTAB(, &fstabname)
2173 IF_FEATURE_MOUNT_VERBOSE(, &verbose)); 2173 IF_FEATURE_MOUNT_VERBOSE(, &verbose));
diff --git a/util-linux/readprofile.c b/util-linux/readprofile.c
index a64540464..345b676ba 100644
--- a/util-linux/readprofile.c
+++ b/util-linux/readprofile.c
@@ -99,8 +99,7 @@ int readprofile_main(int argc UNUSED_PARAM, char **argv)
99 proFile = defaultpro; 99 proFile = defaultpro;
100 mapFile = defaultmap; 100 mapFile = defaultmap;
101 101
102 opt_complementary = "M+"; /* -M N */ 102 opt = getopt32(argv, "M:+m:p:nabsirv", &multiplier, &mapFile, &proFile);
103 opt = getopt32(argv, "M:m:p:nabsirv", &multiplier, &mapFile, &proFile);
104 103
105 if (opt & (OPT_M|OPT_r)) { /* mult or reset, or both */ 104 if (opt & (OPT_M|OPT_r)) { /* mult or reset, or both */
106 int fd, to_write; 105 int fd, to_write;