POSIX says nothing about how to specify no limit, but the ulimits I've
known all take the same "unlimited" as input that they (and POSIX) use
as output.
---
toys/posix/ulimit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From d147837b9c0e33aee65a5a1ea5657dbcc3a4b0b0 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Wed, 2 Mar 2016 18:22:28 -0800
Subject: [PATCH] Fix ulimit parsing of "unlimited".
POSIX says nothing about how to specify no limit, but the ulimits I've
known all take the same "unlimited" as input that they (and POSIX) use
as output.
---
toys/posix/ulimit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/toys/posix/ulimit.c b/toys/posix/ulimit.c
index b4d8e94..865a136 100644
--- a/toys/posix/ulimit.c
+++ b/toys/posix/ulimit.c
@@ -107,7 +107,7 @@ void ulimit_main(void)
if (toys.optc) {
rlim_t val;
- if (tolower(**toys.optargs == 'i')) val = RLIM_INFINITY;
+ if (strcmp(*toys.optargs, "unlimited") == 0) val = RLIM_INFINITY;
else val = atolx_range(*toys.optargs, 0, LONG_MAX);
if (toys.optflags&FLAG_H) rr.rlim_max = val;
--
2.7.0.rc3.207.g0ac5344
_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net