diff options
author | Kang-Che Sung <explorer09@gmail.com> | 2017-02-09 22:48:52 +0800 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-02-12 21:41:24 +0100 |
commit | af316aabf248a14d581aec6c3df1b814a35619af (patch) | |
tree | 5838e3f1a9abb76759c196845f9457324860b144 | |
parent | c393b1e9193601e79ac83efb3b44a7227b9b8af9 (diff) | |
download | busybox-w32-af316aabf248a14d581aec6c3df1b814a35619af.tar.gz busybox-w32-af316aabf248a14d581aec6c3df1b814a35619af.tar.bz2 busybox-w32-af316aabf248a14d581aec6c3df1b814a35619af.zip |
modprobe-small: define and use DEPMOD_OPT_n (option mask)
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | modutils/modprobe-small.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c index 0ac39f66f..485ba4302 100644 --- a/modutils/modprobe-small.c +++ b/modutils/modprobe-small.c | |||
@@ -79,6 +79,7 @@ int lsmod_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
79 | #define is_rmmod (ENABLE_RMMOD && (ONLY_APPLET || applet_name[0] == 'r')) | 79 | #define is_rmmod (ENABLE_RMMOD && (ONLY_APPLET || applet_name[0] == 'r')) |
80 | 80 | ||
81 | enum { | 81 | enum { |
82 | DEPMOD_OPT_n = (1 << 0), /* dry-run, print to stdout */ | ||
82 | OPT_q = (1 << 0), /* be quiet */ | 83 | OPT_q = (1 << 0), /* be quiet */ |
83 | OPT_r = (1 << 1), /* module removal instead of loading */ | 84 | OPT_r = (1 << 1), /* module removal instead of loading */ |
84 | }; | 85 | }; |
@@ -477,7 +478,7 @@ static int start_dep_bb_writeout(void) | |||
477 | int fd; | 478 | int fd; |
478 | 479 | ||
479 | /* depmod -n: write result to stdout */ | 480 | /* depmod -n: write result to stdout */ |
480 | if (applet_name[0] == 'd' && (option_mask32 & 1)) | 481 | if (is_depmod && (option_mask32 & DEPMOD_OPT_n)) |
481 | return STDOUT_FILENO; | 482 | return STDOUT_FILENO; |
482 | 483 | ||
483 | fd = open(DEPFILE_BB".new", O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0644); | 484 | fd = open(DEPFILE_BB".new", O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0644); |