aboutsummaryrefslogtreecommitdiff
path: root/util-linux/blkdiscard.c
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/blkdiscard.c')
-rw-r--r--util-linux/blkdiscard.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/util-linux/blkdiscard.c b/util-linux/blkdiscard.c
index 8f6a4ab6c..5863f0aab 100644
--- a/util-linux/blkdiscard.c
+++ b/util-linux/blkdiscard.c
@@ -11,8 +11,9 @@
11//config: help 11//config: help
12//config: blkdiscard discards sectors on a given device. 12//config: blkdiscard discards sectors on a given device.
13 13
14//applet:IF_BLKDISCARD(APPLET_NOEXEC(blkdiscard, blkdiscard, BB_DIR_USR_BIN, BB_SUID_DROP, blkdiscard))
15
14//kbuild:lib-$(CONFIG_BLKDISCARD) += blkdiscard.o 16//kbuild:lib-$(CONFIG_BLKDISCARD) += blkdiscard.o
15//applet:IF_BLKDISCARD(APPLET(blkdiscard, BB_DIR_USR_BIN, BB_SUID_DROP))
16 17
17//usage:#define blkdiscard_trivial_usage 18//usage:#define blkdiscard_trivial_usage
18//usage: "[-o OFS] [-l LEN] [-s] DEVICE" 19//usage: "[-o OFS] [-l LEN] [-s] DEVICE"
@@ -44,7 +45,6 @@ int blkdiscard_main(int argc UNUSED_PARAM, char **argv)
44 uint64_t offset; /* Leaving these two variables out does not */ 45 uint64_t offset; /* Leaving these two variables out does not */
45 uint64_t length; /* shrink code size and hampers readability. */ 46 uint64_t length; /* shrink code size and hampers readability. */
46 uint64_t range[2]; 47 uint64_t range[2];
47// struct stat st;
48 int fd; 48 int fd;
49 49
50 enum { 50 enum {
@@ -53,8 +53,7 @@ int blkdiscard_main(int argc UNUSED_PARAM, char **argv)
53 OPT_SECURE = (1 << 2), 53 OPT_SECURE = (1 << 2),
54 }; 54 };
55 55
56 opt_complementary = "=1"; 56 opts = getopt32(argv, "^" "o:l:s" "\0" "=1", &offset_str, &length_str);
57 opts = getopt32(argv, "o:l:s", &offset_str, &length_str);
58 argv += optind; 57 argv += optind;
59 58
60 fd = xopen(argv[0], O_RDWR|O_EXCL); 59 fd = xopen(argv[0], O_RDWR|O_EXCL);