diff options
| author | Ron Yorston <rmy@pobox.com> | 2016-05-16 09:33:03 +0100 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2016-05-16 09:33:03 +0100 |
| commit | 35d2f5bccb0f3dde600702ebcdb5424d4d50be4a (patch) | |
| tree | 6e0ff0341c69839e268459a199682628bae734ed /util-linux | |
| parent | 248a2600a2f4b442101ad568d1994b908bb28d4b (diff) | |
| parent | f2559e5c2b7bd2c5fa0dd8e88d0a931da92a23af (diff) | |
| download | busybox-w32-35d2f5bccb0f3dde600702ebcdb5424d4d50be4a.tar.gz busybox-w32-35d2f5bccb0f3dde600702ebcdb5424d4d50be4a.tar.bz2 busybox-w32-35d2f5bccb0f3dde600702ebcdb5424d4d50be4a.zip | |
Merge branch 'busybox' into merge
Diffstat (limited to 'util-linux')
| -rw-r--r-- | util-linux/fatattr.c | 2 | ||||
| -rw-r--r-- | util-linux/flock.c | 21 | ||||
| -rw-r--r-- | util-linux/mdev.c | 4 | ||||
| -rw-r--r-- | util-linux/mkswap.c | 4 | ||||
| -rw-r--r-- | util-linux/more.c | 3 | ||||
| -rw-r--r-- | util-linux/mount.c | 11 | ||||
| -rw-r--r-- | util-linux/nsenter.c | 2 | ||||
| -rw-r--r-- | util-linux/script.c | 10 | ||||
| -rw-r--r-- | util-linux/swaponoff.c | 5 | ||||
| -rw-r--r-- | util-linux/uevent.c | 6 | ||||
| -rw-r--r-- | util-linux/umount.c | 4 | ||||
| -rw-r--r-- | util-linux/unshare.c | 2 | ||||
| -rw-r--r-- | util-linux/volume_id/bcache.c | 2 | ||||
| -rw-r--r-- | util-linux/volume_id/luks.c | 2 |
14 files changed, 55 insertions, 23 deletions
diff --git a/util-linux/fatattr.c b/util-linux/fatattr.c index 5d933874a..6dca24a73 100644 --- a/util-linux/fatattr.c +++ b/util-linux/fatattr.c | |||
| @@ -42,7 +42,7 @@ | |||
| 42 | * Extra space at the end is a hack to print space separator in file listing. | 42 | * Extra space at the end is a hack to print space separator in file listing. |
| 43 | * Let's hope no one ever passes space as an option char :) | 43 | * Let's hope no one ever passes space as an option char :) |
| 44 | */ | 44 | */ |
| 45 | static const char bit_to_char[] = "rhsvda67 "; | 45 | static const char bit_to_char[] ALIGN1 = "rhsvda67 "; |
| 46 | 46 | ||
| 47 | static inline unsigned long get_flag(char c) | 47 | static inline unsigned long get_flag(char c) |
| 48 | { | 48 | { |
diff --git a/util-linux/flock.c b/util-linux/flock.c index 05a747f72..1f7ade7c4 100644 --- a/util-linux/flock.c +++ b/util-linux/flock.c | |||
| @@ -57,7 +57,6 @@ int flock_main(int argc UNUSED_PARAM, char **argv) | |||
| 57 | /* If it is "flock FILE -c PROG", then -c isn't caught by getopt32: | 57 | /* If it is "flock FILE -c PROG", then -c isn't caught by getopt32: |
| 58 | * we use "+" in order to support "flock -opt FILE PROG -with-opts", | 58 | * we use "+" in order to support "flock -opt FILE PROG -with-opts", |
| 59 | * we need to remove -c by hand. | 59 | * we need to remove -c by hand. |
| 60 | * TODO: in upstream, -c 'PROG ARGS' means "run sh -c 'PROG ARGS'" | ||
| 61 | */ | 60 | */ |
| 62 | if (argv[0] | 61 | if (argv[0] |
| 63 | && argv[0][0] == '-' | 62 | && argv[0][0] == '-' |
| @@ -66,6 +65,9 @@ int flock_main(int argc UNUSED_PARAM, char **argv) | |||
| 66 | ) | 65 | ) |
| 67 | ) { | 66 | ) { |
| 68 | argv++; | 67 | argv++; |
| 68 | if (argv[1]) | ||
| 69 | bb_error_msg_and_die("-c takes only one argument"); | ||
| 70 | opt |= OPT_c; | ||
| 69 | } | 71 | } |
| 70 | 72 | ||
| 71 | if (OPT_s == LOCK_SH && OPT_x == LOCK_EX && OPT_n == LOCK_NB && OPT_u == LOCK_UN) { | 73 | if (OPT_s == LOCK_SH && OPT_x == LOCK_EX && OPT_n == LOCK_NB && OPT_u == LOCK_UN) { |
| @@ -90,8 +92,21 @@ int flock_main(int argc UNUSED_PARAM, char **argv) | |||
| 90 | bb_perror_nomsg_and_die(); | 92 | bb_perror_nomsg_and_die(); |
| 91 | } | 93 | } |
| 92 | 94 | ||
| 93 | if (argv[0]) | 95 | if (argv[0]) { |
| 94 | return spawn_and_wait(argv); | 96 | int rc; |
| 97 | if (opt & OPT_c) { | ||
| 98 | /* -c 'PROG ARGS' means "run sh -c 'PROG ARGS'" */ | ||
| 99 | argv -= 2; | ||
| 100 | argv[0] = (char*)get_shell_name(); | ||
| 101 | argv[1] = (char*)"-c"; | ||
| 102 | /* argv[2] = "PROG ARGS"; */ | ||
| 103 | /* argv[3] = NULL; */ | ||
| 104 | } | ||
| 105 | rc = spawn_and_wait(argv); | ||
| 106 | if (rc < 0) | ||
| 107 | bb_simple_perror_msg(argv[0]); | ||
| 108 | return rc; | ||
| 109 | } | ||
| 95 | 110 | ||
| 96 | return EXIT_SUCCESS; | 111 | return EXIT_SUCCESS; |
| 97 | } | 112 | } |
diff --git a/util-linux/mdev.c b/util-linux/mdev.c index 37fa56827..37514eb54 100644 --- a/util-linux/mdev.c +++ b/util-linux/mdev.c | |||
| @@ -97,6 +97,7 @@ | |||
| 97 | //usage: "If /dev/mdev.log file exists, debug log will be appended to it." | 97 | //usage: "If /dev/mdev.log file exists, debug log will be appended to it." |
| 98 | 98 | ||
| 99 | #include "libbb.h" | 99 | #include "libbb.h" |
| 100 | #include "common_bufsiz.h" | ||
| 100 | #include "xregex.h" | 101 | #include "xregex.h" |
| 101 | 102 | ||
| 102 | /* "mdev -s" scans /sys/class/xxx, looking for directories which have dev | 103 | /* "mdev -s" scans /sys/class/xxx, looking for directories which have dev |
| @@ -285,8 +286,9 @@ struct globals { | |||
| 285 | struct rule cur_rule; | 286 | struct rule cur_rule; |
| 286 | char timestr[sizeof("HH:MM:SS.123456")]; | 287 | char timestr[sizeof("HH:MM:SS.123456")]; |
| 287 | } FIX_ALIASING; | 288 | } FIX_ALIASING; |
| 288 | #define G (*(struct globals*)&bb_common_bufsiz1) | 289 | #define G (*(struct globals*)bb_common_bufsiz1) |
| 289 | #define INIT_G() do { \ | 290 | #define INIT_G() do { \ |
| 291 | setup_common_bufsiz(); \ | ||
| 290 | IF_NOT_FEATURE_MDEV_CONF(G.cur_rule.maj = -1;) \ | 292 | IF_NOT_FEATURE_MDEV_CONF(G.cur_rule.maj = -1;) \ |
| 291 | IF_NOT_FEATURE_MDEV_CONF(G.cur_rule.mode = 0660;) \ | 293 | IF_NOT_FEATURE_MDEV_CONF(G.cur_rule.mode = 0660;) \ |
| 292 | } while (0) | 294 | } while (0) |
diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c index b5d2c49b6..dcb53f008 100644 --- a/util-linux/mkswap.c +++ b/util-linux/mkswap.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | //usage: "\n -L LBL Label" | 13 | //usage: "\n -L LBL Label" |
| 14 | 14 | ||
| 15 | #include "libbb.h" | 15 | #include "libbb.h" |
| 16 | #include "common_bufsiz.h" | ||
| 16 | 17 | ||
| 17 | #if ENABLE_SELINUX | 18 | #if ENABLE_SELINUX |
| 18 | static void mkswap_selinux_setcontext(int fd, const char *path) | 19 | static void mkswap_selinux_setcontext(int fd, const char *path) |
| @@ -75,6 +76,7 @@ struct swap_header_v1 { | |||
| 75 | 76 | ||
| 76 | #define NWORDS 129 | 77 | #define NWORDS 129 |
| 77 | #define hdr ((struct swap_header_v1*)bb_common_bufsiz1) | 78 | #define hdr ((struct swap_header_v1*)bb_common_bufsiz1) |
| 79 | #define INIT_G() do { setup_common_bufsiz(); } while (0) | ||
| 78 | 80 | ||
| 79 | struct BUG_sizes { | 81 | struct BUG_sizes { |
| 80 | char swap_header_v1_wrong[sizeof(*hdr) != (NWORDS * 4) ? -1 : 1]; | 82 | char swap_header_v1_wrong[sizeof(*hdr) != (NWORDS * 4) ? -1 : 1]; |
| @@ -92,6 +94,8 @@ int mkswap_main(int argc UNUSED_PARAM, char **argv) | |||
| 92 | off_t len; | 94 | off_t len; |
| 93 | const char *label = ""; | 95 | const char *label = ""; |
| 94 | 96 | ||
| 97 | INIT_G(); | ||
| 98 | |||
| 95 | opt_complementary = "-1"; /* at least one param */ | 99 | opt_complementary = "-1"; /* at least one param */ |
| 96 | /* TODO: -p PAGESZ, -U UUID */ | 100 | /* TODO: -p PAGESZ, -U UUID */ |
| 97 | getopt32(argv, "L:", &label); | 101 | getopt32(argv, "L:", &label); |
diff --git a/util-linux/more.c b/util-linux/more.c index 29984df8c..4812f1bc5 100644 --- a/util-linux/more.c +++ b/util-linux/more.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <conio.h> | 26 | #include <conio.h> |
| 27 | #endif | 27 | #endif |
| 28 | #include "libbb.h" | 28 | #include "libbb.h" |
| 29 | #include "common_bufsiz.h" | ||
| 29 | 30 | ||
| 30 | /* Support for FEATURE_USE_TERMIOS */ | 31 | /* Support for FEATURE_USE_TERMIOS */ |
| 31 | 32 | ||
| @@ -35,10 +36,10 @@ struct globals { | |||
| 35 | struct termios new_settings; | 36 | struct termios new_settings; |
| 36 | } FIX_ALIASING; | 37 | } FIX_ALIASING; |
| 37 | #define G (*(struct globals*)bb_common_bufsiz1) | 38 | #define G (*(struct globals*)bb_common_bufsiz1) |
| 38 | #define INIT_G() ((void)0) | ||
| 39 | #define initial_settings (G.initial_settings) | 39 | #define initial_settings (G.initial_settings) |
| 40 | #define new_settings (G.new_settings ) | 40 | #define new_settings (G.new_settings ) |
| 41 | #define cin_fileno (G.cin_fileno ) | 41 | #define cin_fileno (G.cin_fileno ) |
| 42 | #define INIT_G() do { setup_common_bufsiz(); } while (0) | ||
| 42 | 43 | ||
| 43 | #define setTermSettings(fd, argp) \ | 44 | #define setTermSettings(fd, argp) \ |
| 44 | do { \ | 45 | do { \ |
diff --git a/util-linux/mount.c b/util-linux/mount.c index c428f5827..c76f6ef61 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
| @@ -223,6 +223,7 @@ | |||
| 223 | #define BB_MS_INVERTED_VALUE (1u << 31) | 223 | #define BB_MS_INVERTED_VALUE (1u << 31) |
| 224 | 224 | ||
| 225 | #include "libbb.h" | 225 | #include "libbb.h" |
| 226 | #include "common_bufsiz.h" | ||
| 226 | #if ENABLE_FEATURE_MOUNT_LABEL | 227 | #if ENABLE_FEATURE_MOUNT_LABEL |
| 227 | # include "volume_id.h" | 228 | # include "volume_id.h" |
| 228 | #else | 229 | #else |
| @@ -376,7 +377,7 @@ static const int32_t mount_options[] = { | |||
| 376 | /* "remount" */ MS_REMOUNT // action flag | 377 | /* "remount" */ MS_REMOUNT // action flag |
| 377 | }; | 378 | }; |
| 378 | 379 | ||
| 379 | static const char mount_option_str[] = | 380 | static const char mount_option_str[] ALIGN1 = |
| 380 | IF_FEATURE_MOUNT_LOOP( | 381 | IF_FEATURE_MOUNT_LOOP( |
| 381 | "loop\0" | 382 | "loop\0" |
| 382 | ) | 383 | ) |
| @@ -447,7 +448,7 @@ struct globals { | |||
| 447 | char getmntent_buf[1]; | 448 | char getmntent_buf[1]; |
| 448 | } FIX_ALIASING; | 449 | } FIX_ALIASING; |
| 449 | enum { GETMNTENT_BUFSIZE = COMMON_BUFSIZE - offsetof(struct globals, getmntent_buf) }; | 450 | enum { GETMNTENT_BUFSIZE = COMMON_BUFSIZE - offsetof(struct globals, getmntent_buf) }; |
| 450 | #define G (*(struct globals*)&bb_common_bufsiz1) | 451 | #define G (*(struct globals*)bb_common_bufsiz1) |
| 451 | #define nfs_mount_version (G.nfs_mount_version) | 452 | #define nfs_mount_version (G.nfs_mount_version) |
| 452 | #if ENABLE_FEATURE_MOUNT_VERBOSE | 453 | #if ENABLE_FEATURE_MOUNT_VERBOSE |
| 453 | #define verbose (G.verbose ) | 454 | #define verbose (G.verbose ) |
| @@ -456,7 +457,7 @@ enum { GETMNTENT_BUFSIZE = COMMON_BUFSIZE - offsetof(struct globals, getmntent_b | |||
| 456 | #endif | 457 | #endif |
| 457 | #define fslist (G.fslist ) | 458 | #define fslist (G.fslist ) |
| 458 | #define getmntent_buf (G.getmntent_buf ) | 459 | #define getmntent_buf (G.getmntent_buf ) |
| 459 | #define INIT_G() do { } while (0) | 460 | #define INIT_G() do { setup_common_bufsiz(); } while (0) |
| 460 | 461 | ||
| 461 | #if ENABLE_FEATURE_MTAB_SUPPORT | 462 | #if ENABLE_FEATURE_MTAB_SUPPORT |
| 462 | /* | 463 | /* |
| @@ -1002,7 +1003,7 @@ enum { | |||
| 1002 | # define EDQUOT ENOSPC | 1003 | # define EDQUOT ENOSPC |
| 1003 | #endif | 1004 | #endif |
| 1004 | /* Convert each NFSERR_BLAH into EBLAH */ | 1005 | /* Convert each NFSERR_BLAH into EBLAH */ |
| 1005 | static const uint8_t nfs_err_stat[] = { | 1006 | static const uint8_t nfs_err_stat[] ALIGN1 = { |
| 1006 | 1, 2, 5, 6, 13, 17, | 1007 | 1, 2, 5, 6, 13, 17, |
| 1007 | 19, 20, 21, 22, 27, 28, | 1008 | 19, 20, 21, 22, 27, 28, |
| 1008 | 30, 63, 66, 69, 70, 71 | 1009 | 30, 63, 66, 69, 70, 71 |
| @@ -1015,7 +1016,7 @@ typedef uint8_t nfs_err_type; | |||
| 1015 | #else | 1016 | #else |
| 1016 | typedef uint16_t nfs_err_type; | 1017 | typedef uint16_t nfs_err_type; |
| 1017 | #endif | 1018 | #endif |
| 1018 | static const nfs_err_type nfs_err_errnum[] = { | 1019 | static const nfs_err_type nfs_err_errnum[] ALIGN2 = { |
| 1019 | EPERM , ENOENT , EIO , ENXIO , EACCES, EEXIST, | 1020 | EPERM , ENOENT , EIO , ENXIO , EACCES, EEXIST, |
| 1020 | ENODEV, ENOTDIR , EISDIR , EINVAL, EFBIG , ENOSPC, | 1021 | ENODEV, ENOTDIR , EISDIR , EINVAL, EFBIG , ENOSPC, |
| 1021 | EROFS , ENAMETOOLONG, ENOTEMPTY, EDQUOT, ESTALE, EREMOTE | 1022 | EROFS , ENAMETOOLONG, ENOTEMPTY, EDQUOT, ESTALE, EREMOTE |
diff --git a/util-linux/nsenter.c b/util-linux/nsenter.c index b08b3dae7..6834292da 100644 --- a/util-linux/nsenter.c +++ b/util-linux/nsenter.c | |||
| @@ -128,7 +128,7 @@ static const struct namespace_descr ns_list[] = { | |||
| 128 | /* | 128 | /* |
| 129 | * Upstream nsenter doesn't support the short option for --preserve-credentials | 129 | * Upstream nsenter doesn't support the short option for --preserve-credentials |
| 130 | */ | 130 | */ |
| 131 | static const char opt_str[] = "U::i::u::n::p::m::""t+S+G+r::w::F"; | 131 | static const char opt_str[] ALIGN1 = "U::i::u::n::p::m::""t+S+G+r::w::F"; |
| 132 | 132 | ||
| 133 | #if ENABLE_FEATURE_NSENTER_LONG_OPTS | 133 | #if ENABLE_FEATURE_NSENTER_LONG_OPTS |
| 134 | static const char nsenter_longopts[] ALIGN1 = | 134 | static const char nsenter_longopts[] ALIGN1 = |
diff --git a/util-linux/script.c b/util-linux/script.c index abcd73bff..86475c1f1 100644 --- a/util-linux/script.c +++ b/util-linux/script.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | //usage: ) | 23 | //usage: ) |
| 24 | 24 | ||
| 25 | #include "libbb.h" | 25 | #include "libbb.h" |
| 26 | #include "common_bufsiz.h" | ||
| 26 | 27 | ||
| 27 | int script_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 28 | int script_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
| 28 | int script_main(int argc UNUSED_PARAM, char **argv) | 29 | int script_main(int argc UNUSED_PARAM, char **argv) |
| @@ -108,11 +109,12 @@ int script_main(int argc UNUSED_PARAM, char **argv) | |||
| 108 | 109 | ||
| 109 | if (child_pid) { | 110 | if (child_pid) { |
| 110 | /* parent */ | 111 | /* parent */ |
| 111 | #define buf bb_common_bufsiz1 | ||
| 112 | struct pollfd pfd[2]; | 112 | struct pollfd pfd[2]; |
| 113 | int outfd, count, loop; | 113 | int outfd, count, loop; |
| 114 | double oldtime = ENABLE_SCRIPTREPLAY ? time(NULL) : 0; | 114 | double oldtime = ENABLE_SCRIPTREPLAY ? time(NULL) : 0; |
| 115 | smallint fd_count = 2; | 115 | smallint fd_count = 2; |
| 116 | #define buf bb_common_bufsiz1 | ||
| 117 | setup_common_bufsiz(); | ||
| 116 | 118 | ||
| 117 | outfd = xopen(fname, mode); | 119 | outfd = xopen(fname, mode); |
| 118 | pfd[0].fd = pty; | 120 | pfd[0].fd = pty; |
| @@ -134,7 +136,7 @@ int script_main(int argc UNUSED_PARAM, char **argv) | |||
| 134 | } | 136 | } |
| 135 | if (pfd[0].revents) { | 137 | if (pfd[0].revents) { |
| 136 | errno = 0; | 138 | errno = 0; |
| 137 | count = safe_read(pty, buf, sizeof(buf)); | 139 | count = safe_read(pty, buf, COMMON_BUFSIZE); |
| 138 | if (count <= 0 && errno != EAGAIN) { | 140 | if (count <= 0 && errno != EAGAIN) { |
| 139 | /* err/eof from pty: exit */ | 141 | /* err/eof from pty: exit */ |
| 140 | goto restore; | 142 | goto restore; |
| @@ -157,7 +159,7 @@ int script_main(int argc UNUSED_PARAM, char **argv) | |||
| 157 | } | 159 | } |
| 158 | } | 160 | } |
| 159 | if (pfd[1].revents) { | 161 | if (pfd[1].revents) { |
| 160 | count = safe_read(STDIN_FILENO, buf, sizeof(buf)); | 162 | count = safe_read(STDIN_FILENO, buf, COMMON_BUFSIZE); |
| 161 | if (count <= 0) { | 163 | if (count <= 0) { |
| 162 | /* err/eof from stdin: don't read stdin anymore */ | 164 | /* err/eof from stdin: don't read stdin anymore */ |
| 163 | pfd[1].revents = 0; | 165 | pfd[1].revents = 0; |
| @@ -176,7 +178,7 @@ int script_main(int argc UNUSED_PARAM, char **argv) | |||
| 176 | * (util-linux's script doesn't do this. buggy :) */ | 178 | * (util-linux's script doesn't do this. buggy :) */ |
| 177 | loop = 999; | 179 | loop = 999; |
| 178 | /* pty is in O_NONBLOCK mode, we exit as soon as buffer is empty */ | 180 | /* pty is in O_NONBLOCK mode, we exit as soon as buffer is empty */ |
| 179 | while (--loop && (count = safe_read(pty, buf, sizeof(buf))) > 0) { | 181 | while (--loop && (count = safe_read(pty, buf, COMMON_BUFSIZE)) > 0) { |
| 180 | full_write(STDOUT_FILENO, buf, count); | 182 | full_write(STDOUT_FILENO, buf, count); |
| 181 | full_write(outfd, buf, count); | 183 | full_write(outfd, buf, count); |
| 182 | } | 184 | } |
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c index c29dd3071..6713852e5 100644 --- a/util-linux/swaponoff.c +++ b/util-linux/swaponoff.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | //usage: "\n -a Stop swapping on all swap devices" | 28 | //usage: "\n -a Stop swapping on all swap devices" |
| 29 | 29 | ||
| 30 | #include "libbb.h" | 30 | #include "libbb.h" |
| 31 | #include "common_bufsiz.h" | ||
| 31 | #include <mntent.h> | 32 | #include <mntent.h> |
| 32 | #ifndef __BIONIC__ | 33 | #ifndef __BIONIC__ |
| 33 | # include <sys/swap.h> | 34 | # include <sys/swap.h> |
| @@ -62,7 +63,7 @@ | |||
| 62 | struct globals { | 63 | struct globals { |
| 63 | int flags; | 64 | int flags; |
| 64 | } FIX_ALIASING; | 65 | } FIX_ALIASING; |
| 65 | #define G (*(struct globals*)&bb_common_bufsiz1) | 66 | #define G (*(struct globals*)bb_common_bufsiz1) |
| 66 | #define g_flags (G.flags) | 67 | #define g_flags (G.flags) |
| 67 | #define save_g_flags() int save_g_flags = g_flags | 68 | #define save_g_flags() int save_g_flags = g_flags |
| 68 | #define restore_g_flags() g_flags = save_g_flags | 69 | #define restore_g_flags() g_flags = save_g_flags |
| @@ -71,7 +72,7 @@ struct globals { | |||
| 71 | #define save_g_flags() ((void)0) | 72 | #define save_g_flags() ((void)0) |
| 72 | #define restore_g_flags() ((void)0) | 73 | #define restore_g_flags() ((void)0) |
| 73 | #endif | 74 | #endif |
| 74 | #define INIT_G() do { } while (0) | 75 | #define INIT_G() do { setup_common_bufsiz(); } while (0) |
| 75 | 76 | ||
| 76 | #define do_swapoff (applet_name[5] == 'f') | 77 | #define do_swapoff (applet_name[5] == 'f') |
| 77 | 78 | ||
diff --git a/util-linux/uevent.c b/util-linux/uevent.c index 514a9e934..b98fe6160 100644 --- a/util-linux/uevent.c +++ b/util-linux/uevent.c | |||
| @@ -25,11 +25,13 @@ | |||
| 25 | //usage: "\n"" # uevent mdev & mdev -s" | 25 | //usage: "\n"" # uevent mdev & mdev -s" |
| 26 | 26 | ||
| 27 | #include "libbb.h" | 27 | #include "libbb.h" |
| 28 | #include "common_bufsiz.h" | ||
| 28 | #include <linux/netlink.h> | 29 | #include <linux/netlink.h> |
| 29 | 30 | ||
| 30 | #define BUFFER_SIZE 16*1024 | 31 | #define BUFFER_SIZE 16*1024 |
| 31 | 32 | ||
| 32 | #define env ((char **)&bb_common_bufsiz1) | 33 | #define env ((char **)bb_common_bufsiz1) |
| 34 | #define INIT_G() do { setup_common_bufsiz(); } while (0) | ||
| 33 | enum { | 35 | enum { |
| 34 | MAX_ENV = COMMON_BUFSIZE / sizeof(env[0]) - 1, | 36 | MAX_ENV = COMMON_BUFSIZE / sizeof(env[0]) - 1, |
| 35 | }; | 37 | }; |
| @@ -45,6 +47,8 @@ int uevent_main(int argc UNUSED_PARAM, char **argv) | |||
| 45 | struct sockaddr_nl sa; | 47 | struct sockaddr_nl sa; |
| 46 | int fd; | 48 | int fd; |
| 47 | 49 | ||
| 50 | INIT_G(); | ||
| 51 | |||
| 48 | argv++; | 52 | argv++; |
| 49 | 53 | ||
| 50 | // Subscribe for UEVENT kernel messages | 54 | // Subscribe for UEVENT kernel messages |
diff --git a/util-linux/umount.c b/util-linux/umount.c index 30bef1686..91da69674 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | # define MNT_DETACH 0x00000002 | 34 | # define MNT_DETACH 0x00000002 |
| 35 | #endif | 35 | #endif |
| 36 | #include "libbb.h" | 36 | #include "libbb.h" |
| 37 | #include "common_bufsiz.h" | ||
| 37 | 38 | ||
| 38 | #if defined(__dietlibc__) | 39 | #if defined(__dietlibc__) |
| 39 | // TODO: This does not belong here. | 40 | // TODO: This does not belong here. |
| @@ -102,7 +103,8 @@ int umount_main(int argc UNUSED_PARAM, char **argv) | |||
| 102 | if (opt & OPT_ALL) | 103 | if (opt & OPT_ALL) |
| 103 | bb_error_msg_and_die("can't open '%s'", bb_path_mtab_file); | 104 | bb_error_msg_and_die("can't open '%s'", bb_path_mtab_file); |
| 104 | } else { | 105 | } else { |
| 105 | while (getmntent_r(fp, &me, bb_common_bufsiz1, sizeof(bb_common_bufsiz1))) { | 106 | setup_common_bufsiz(); |
| 107 | while (getmntent_r(fp, &me, bb_common_bufsiz1, COMMON_BUFSIZE)) { | ||
| 106 | /* Match fstype if passed */ | 108 | /* Match fstype if passed */ |
| 107 | if (!match_fstype(&me, fstype)) | 109 | if (!match_fstype(&me, fstype)) |
| 108 | continue; | 110 | continue; |
diff --git a/util-linux/unshare.c b/util-linux/unshare.c index d05cfdb6c..fa7086add 100644 --- a/util-linux/unshare.c +++ b/util-linux/unshare.c | |||
| @@ -137,7 +137,7 @@ static const struct namespace_descr ns_list[] = { | |||
| 137 | * we are forced to use "fake" letters for them. | 137 | * we are forced to use "fake" letters for them. |
| 138 | * '+': stop at first non-option. | 138 | * '+': stop at first non-option. |
| 139 | */ | 139 | */ |
| 140 | static const char opt_str[] = "+muinpU""fr""\xfd::""\xfe:""\xff:"; | 140 | static const char opt_str[] ALIGN1 = "+muinpU""fr""\xfd::""\xfe:""\xff:"; |
| 141 | static const char unshare_longopts[] ALIGN1 = | 141 | static const char unshare_longopts[] ALIGN1 = |
| 142 | "mount\0" Optional_argument "\xf0" | 142 | "mount\0" Optional_argument "\xf0" |
| 143 | "uts\0" Optional_argument "\xf1" | 143 | "uts\0" Optional_argument "\xf1" |
diff --git a/util-linux/volume_id/bcache.c b/util-linux/volume_id/bcache.c index 648e44de5..fd40eb081 100644 --- a/util-linux/volume_id/bcache.c +++ b/util-linux/volume_id/bcache.c | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | #define SB_LABEL_SIZE 32 | 24 | #define SB_LABEL_SIZE 32 |
| 25 | #define SB_JOURNAL_BUCKETS 256U | 25 | #define SB_JOURNAL_BUCKETS 256U |
| 26 | 26 | ||
| 27 | static const char bcache_magic[] = { | 27 | static const char bcache_magic[] ALIGN1 = { |
| 28 | 0xc6, 0x85, 0x73, 0xf6, 0x4e, 0x1a, 0x45, 0xca, | 28 | 0xc6, 0x85, 0x73, 0xf6, 0x4e, 0x1a, 0x45, 0xca, |
| 29 | 0x82, 0x65, 0xf5, 0x7f, 0x48, 0xba, 0x6d, 0x81 | 29 | 0x82, 0x65, 0xf5, 0x7f, 0x48, 0xba, 0x6d, 0x81 |
| 30 | }; | 30 | }; |
diff --git a/util-linux/volume_id/luks.c b/util-linux/volume_id/luks.c index 42bf87659..21cb26f51 100644 --- a/util-linux/volume_id/luks.c +++ b/util-linux/volume_id/luks.c | |||
| @@ -40,7 +40,7 @@ | |||
| 40 | #define LUKS_SALTSIZE 32 | 40 | #define LUKS_SALTSIZE 32 |
| 41 | #define LUKS_NUMKEYS 8 | 41 | #define LUKS_NUMKEYS 8 |
| 42 | 42 | ||
| 43 | static const uint8_t LUKS_MAGIC[] = { 'L','U','K','S', 0xba, 0xbe }; | 43 | static const uint8_t LUKS_MAGIC[] ALIGN1 = { 'L','U','K','S', 0xba, 0xbe }; |
| 44 | 44 | ||
| 45 | struct luks_phdr { | 45 | struct luks_phdr { |
| 46 | uint8_t magic[LUKS_MAGIC_L]; | 46 | uint8_t magic[LUKS_MAGIC_L]; |
