From: Kang-Che Sung Date: Thu, 9 Feb 2017 14:48:52 +0000 (+0800) Subject: modprobe-small: define and use DEPMOD_OPT_n (option mask) X-Git-Tag: 1_27_0~123 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=af316aabf248a14d581aec6c3df1b814a35619af;p=oweals%2Fbusybox.git modprobe-small: define and use DEPMOD_OPT_n (option mask) Signed-off-by: Kang-Che Sung Signed-off-by: Denys Vlasenko --- 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) #define is_rmmod (ENABLE_RMMOD && (ONLY_APPLET || applet_name[0] == 'r')) enum { + DEPMOD_OPT_n = (1 << 0), /* dry-run, print to stdout */ OPT_q = (1 << 0), /* be quiet */ OPT_r = (1 << 1), /* module removal instead of loading */ }; @@ -477,7 +478,7 @@ static int start_dep_bb_writeout(void) int fd; /* depmod -n: write result to stdout */ - if (applet_name[0] == 'd' && (option_mask32 & 1)) + if (is_depmod && (option_mask32 & DEPMOD_OPT_n)) return STDOUT_FILENO; fd = open(DEPFILE_BB".new", O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0644);