diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-06-05 20:42:40 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-06-05 20:42:40 +0200 |
commit | 035b4d77dc8e45862600d911aaade5e40d7bdee4 (patch) | |
tree | 4a357714c7f73e86b86b84945d71ea4e5b12bf5c | |
parent | 71016baf5524d739d1dd4d9110b111a7c3ddcaf9 (diff) | |
download | busybox-w32-035b4d77dc8e45862600d911aaade5e40d7bdee4.tar.gz busybox-w32-035b4d77dc8e45862600d911aaade5e40d7bdee4.tar.bz2 busybox-w32-035b4d77dc8e45862600d911aaade5e40d7bdee4.zip |
ftpd: allow multiple -S options to increase verbosity too, like -v
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | networking/ftpd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/networking/ftpd.c b/networking/ftpd.c index 090ed54eb..a8687fbda 100644 --- a/networking/ftpd.c +++ b/networking/ftpd.c | |||
@@ -1095,17 +1095,19 @@ int ftpd_main(int argc UNUSED_PARAM, char **argv) | |||
1095 | #endif | 1095 | #endif |
1096 | { | 1096 | { |
1097 | unsigned abs_timeout; | 1097 | unsigned abs_timeout; |
1098 | unsigned verbose_S; | ||
1098 | smallint opts; | 1099 | smallint opts; |
1099 | 1100 | ||
1100 | INIT_G(); | 1101 | INIT_G(); |
1101 | 1102 | ||
1102 | abs_timeout = 1 * 60 * 60; | 1103 | abs_timeout = 1 * 60 * 60; |
1104 | verbose_S = 0; | ||
1103 | G.timeout = 2 * 60; | 1105 | G.timeout = 2 * 60; |
1104 | opt_complementary = "t+:T+:vv"; | 1106 | opt_complementary = "t+:T+:vv:SS"; |
1105 | #if BB_MMU | 1107 | #if BB_MMU |
1106 | opts = getopt32(argv, "vS" IF_FEATURE_FTP_WRITE("w") "t:T:", &G.timeout, &abs_timeout, &G.verbose); | 1108 | opts = getopt32(argv, "vS" IF_FEATURE_FTP_WRITE("w") "t:T:", &G.timeout, &abs_timeout, &G.verbose, &verbose_S); |
1107 | #else | 1109 | #else |
1108 | opts = getopt32(argv, "l1vS" IF_FEATURE_FTP_WRITE("w") "t:T:", &G.timeout, &abs_timeout, &G.verbose); | 1110 | opts = getopt32(argv, "l1vS" IF_FEATURE_FTP_WRITE("w") "t:T:", &G.timeout, &abs_timeout, &G.verbose, &verbose_S); |
1109 | if (opts & (OPT_l|OPT_1)) { | 1111 | if (opts & (OPT_l|OPT_1)) { |
1110 | /* Our secret backdoor to ls */ | 1112 | /* Our secret backdoor to ls */ |
1111 | /* TODO: pass -n too? */ | 1113 | /* TODO: pass -n too? */ |
@@ -1116,6 +1118,8 @@ int ftpd_main(int argc UNUSED_PARAM, char **argv) | |||
1116 | return ls_main(argc, argv); | 1118 | return ls_main(argc, argv); |
1117 | } | 1119 | } |
1118 | #endif | 1120 | #endif |
1121 | if (G.verbose < verbose_S) | ||
1122 | G.verbose = verbose_S; | ||
1119 | if (abs_timeout | G.timeout) { | 1123 | if (abs_timeout | G.timeout) { |
1120 | if (abs_timeout == 0) | 1124 | if (abs_timeout == 0) |
1121 | abs_timeout = INT_MAX; | 1125 | abs_timeout = INT_MAX; |