diff options
author | Ron Yorston <rmy@pobox.com> | 2019-05-27 11:56:52 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2019-05-27 11:56:52 +0100 |
commit | a61949401890cbb33a9d6c4571b51c53460ad438 (patch) | |
tree | 64dedaddb89896d5b1670a421af123670ca2120b /util-linux | |
parent | 03a7b173605a890e1db5177ecd5b8dd591081c41 (diff) | |
parent | bcb1fc3e6ca6fe902610f507eaf9b0b58a5c583a (diff) | |
download | busybox-w32-a61949401890cbb33a9d6c4571b51c53460ad438.tar.gz busybox-w32-a61949401890cbb33a9d6c4571b51c53460ad438.tar.bz2 busybox-w32-a61949401890cbb33a9d6c4571b51c53460ad438.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/losetup.c | 32 | ||||
-rw-r--r-- | util-linux/mount.c | 5 |
2 files changed, 26 insertions, 11 deletions
diff --git a/util-linux/losetup.c b/util-linux/losetup.c index bf480e9bf..2248f2cba 100644 --- a/util-linux/losetup.c +++ b/util-linux/losetup.c | |||
@@ -20,10 +20,11 @@ | |||
20 | //kbuild:lib-$(CONFIG_LOSETUP) += losetup.o | 20 | //kbuild:lib-$(CONFIG_LOSETUP) += losetup.o |
21 | 21 | ||
22 | //usage:#define losetup_trivial_usage | 22 | //usage:#define losetup_trivial_usage |
23 | //usage: "[-r] [-o OFS] {-f|LOOPDEV} FILE - associate loop devices\n" | 23 | //usage: "[-r] [-o OFS] {-f|LOOPDEV} FILE: associate loop devices\n" |
24 | //usage: " losetup -d LOOPDEV - disassociate\n" | 24 | //usage: " losetup -c LOOPDEV: reread file size\n" |
25 | //usage: " losetup -a - show status\n" | 25 | //usage: " losetup -d LOOPDEV: disassociate\n" |
26 | //usage: " losetup -f - show next free loop device" | 26 | //usage: " losetup -a: show status\n" |
27 | //usage: " losetup -f: show next free loop device" | ||
27 | //usage:#define losetup_full_usage "\n\n" | 28 | //usage:#define losetup_full_usage "\n\n" |
28 | //usage: " -o OFS Start OFS bytes into FILE" | 29 | //usage: " -o OFS Start OFS bytes into FILE" |
29 | //usage: "\n -r Read-only" | 30 | //usage: "\n -r Read-only" |
@@ -50,14 +51,15 @@ int losetup_main(int argc UNUSED_PARAM, char **argv) | |||
50 | char *opt_o; | 51 | char *opt_o; |
51 | char dev[LOOP_NAMESIZE]; | 52 | char dev[LOOP_NAMESIZE]; |
52 | enum { | 53 | enum { |
53 | OPT_d = (1 << 0), | 54 | OPT_c = (1 << 0), |
54 | OPT_o = (1 << 1), | 55 | OPT_d = (1 << 1), |
55 | OPT_f = (1 << 2), | 56 | OPT_o = (1 << 2), |
56 | OPT_a = (1 << 3), | 57 | OPT_f = (1 << 3), |
57 | OPT_r = (1 << 4), /* must be last */ | 58 | OPT_a = (1 << 4), |
59 | OPT_r = (1 << 5), | ||
58 | }; | 60 | }; |
59 | 61 | ||
60 | opt = getopt32(argv, "^" "do:far" "\0" "?2:d--ofar:a--ofr", &opt_o); | 62 | opt = getopt32(argv, "^" "cdo:far" "\0" "?2:d--ofar:a--ofr", &opt_o); |
61 | argv += optind; | 63 | argv += optind; |
62 | 64 | ||
63 | /* LOOPDEV */ | 65 | /* LOOPDEV */ |
@@ -73,6 +75,16 @@ int losetup_main(int argc UNUSED_PARAM, char **argv) | |||
73 | return EXIT_SUCCESS; | 75 | return EXIT_SUCCESS; |
74 | } | 76 | } |
75 | 77 | ||
78 | /* -c LOOPDEV */ | ||
79 | if (opt == OPT_c && argv[0]) { | ||
80 | int fd = xopen(argv[0], O_RDONLY); | ||
81 | #ifndef LOOP_SET_CAPACITY | ||
82 | # define LOOP_SET_CAPACITY 0x4C07 | ||
83 | #endif | ||
84 | xioctl(fd, LOOP_SET_CAPACITY, /*ignored:*/0); | ||
85 | return EXIT_SUCCESS; | ||
86 | } | ||
87 | |||
76 | /* -d LOOPDEV */ | 88 | /* -d LOOPDEV */ |
77 | if (opt == OPT_d && argv[0]) { | 89 | if (opt == OPT_d && argv[0]) { |
78 | if (del_loop(argv[0])) | 90 | if (del_loop(argv[0])) |
diff --git a/util-linux/mount.c b/util-linux/mount.c index 526b4130c..e6bad7c2c 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
@@ -1194,7 +1194,10 @@ static int daemonize(void) | |||
1194 | return 1; | 1194 | return 1; |
1195 | } | 1195 | } |
1196 | #else | 1196 | #else |
1197 | static inline int daemonize(void) { return -ENOSYS; } | 1197 | static inline int daemonize(void) |
1198 | { | ||
1199 | return -ENOSYS; | ||
1200 | } | ||
1198 | #endif | 1201 | #endif |
1199 | 1202 | ||
1200 | /* TODO */ | 1203 | /* TODO */ |