diff options
author | Alexander Shishkin <virtuoso@slind.org> | 2010-07-27 08:40:55 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-07-27 08:40:55 +0200 |
commit | 17e0e43c3522882e2ac8e921132540ba01a1c66c (patch) | |
tree | dea5b907947dd291fb756676a6a2095a5f36d374 /shell/shell_common.c | |
parent | 06702365d7faf47ebfc5b5453d73ade235ea4c65 (diff) | |
download | busybox-w32-17e0e43c3522882e2ac8e921132540ba01a1c66c.tar.gz busybox-w32-17e0e43c3522882e2ac8e921132540ba01a1c66c.tar.bz2 busybox-w32-17e0e43c3522882e2ac8e921132540ba01a1c66c.zip |
ulimit: set both hard and soft limits by default
function old new delta
shell_builtin_ulimit 494 498 +4
Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/shell_common.c')
-rw-r--r-- | shell/shell_common.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/shell/shell_common.c b/shell/shell_common.c index 3114ff3f7..dc363e298 100644 --- a/shell/shell_common.c +++ b/shell/shell_common.c | |||
@@ -428,9 +428,14 @@ shell_builtin_ulimit(char **argv) | |||
428 | val <<= l->factor_shift; | 428 | val <<= l->factor_shift; |
429 | } | 429 | } |
430 | //bb_error_msg("opt %c val_str:'%s' val:%lld", opt_char, val_str, (long long)val); | 430 | //bb_error_msg("opt %c val_str:'%s' val:%lld", opt_char, val_str, (long long)val); |
431 | /* from man bash: "If neither -H nor -S | ||
432 | * is specified, both the soft and hard | ||
433 | * limits are set. */ | ||
434 | if (!opts) | ||
435 | opts = OPT_hard + OPT_soft; | ||
431 | if (opts & OPT_hard) | 436 | if (opts & OPT_hard) |
432 | limit.rlim_max = val; | 437 | limit.rlim_max = val; |
433 | if ((opts & OPT_soft) || opts == 0) | 438 | if (opts & OPT_soft) |
434 | limit.rlim_cur = val; | 439 | limit.rlim_cur = val; |
435 | //bb_error_msg("setrlimit(%d, %lld, %lld)", l->cmd, (long long)limit.rlim_cur, (long long)limit.rlim_max); | 440 | //bb_error_msg("setrlimit(%d, %lld, %lld)", l->cmd, (long long)limit.rlim_cur, (long long)limit.rlim_max); |
436 | if (setrlimit(l->cmd, &limit) < 0) { | 441 | if (setrlimit(l->cmd, &limit) < 0) { |