diff options
author | Petter Rodhelind <petter.rodhelind@gmail.com> | 2018-01-25 11:19:36 +0100 |
---|---|---|
committer | Petter Rodhelind <petter.rodhelind@gmail.com> | 2018-01-25 11:19:36 +0100 |
commit | 2098de7820e5440c36e8e9c63da75e00e833cd28 (patch) | |
tree | 81ede0b2d9199cfe084f0abd1e2c4a450e302c9a /src/cmd/rc/unixcrap.c | |
parent | e439c5997622c3a86c113706ca87f1f9abf5a887 (diff) | |
parent | da8a485fc143aa323845fafcf0f0f836c76a116b (diff) | |
download | plan9port-2098de7820e5440c36e8e9c63da75e00e833cd28.tar.gz plan9port-2098de7820e5440c36e8e9c63da75e00e833cd28.tar.bz2 plan9port-2098de7820e5440c36e8e9c63da75e00e833cd28.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/cmd/rc/unixcrap.c')
-rw-r--r-- | src/cmd/rc/unixcrap.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/cmd/rc/unixcrap.c b/src/cmd/rc/unixcrap.c index 9393fb23..0b915635 100644 --- a/src/cmd/rc/unixcrap.c +++ b/src/cmd/rc/unixcrap.c @@ -58,7 +58,8 @@ eusage(void) void execulimit(void) { - int fd, n, argc, sethard, setsoft, limit; + rlim_t n; + int fd, argc, sethard, setsoft, limit; int flag[256]; char **argv, **oargv, *p; char *argv0; @@ -118,10 +119,10 @@ execulimit(void) for(p=eargs; *p; p++){ getrlimit(rlx[p-eargs], &rl); n = flag['H'] ? rl.rlim_max : rl.rlim_cur; - if(n == -1) + if(n == RLIM_INFINITY) fprint(fd, "ulimit -%c unlimited\n", *p); else - fprint(fd, "ulimit -%c %d\n", *p, n); + fprint(fd, "ulimit -%c %llud\n", *p, (uvlong)n); } goto out; } @@ -132,10 +133,10 @@ execulimit(void) switch(limit){ case Notset: n = flag['H'] ? rl.rlim_max : rl.rlim_cur; - if(n == -1) + if(n == RLIM_INFINITY) fprint(fd, "ulimit -%c unlimited\n", *p); else - fprint(fd, "ulimit -%c %d\n", *p, n); + fprint(fd, "ulimit -%c %llud\n", *p, (uvlong)n); break; case Hard: n = rl.rlim_max; @@ -144,7 +145,7 @@ execulimit(void) n = rl.rlim_cur; goto set; case Unlimited: - n = -1; + n = RLIM_INFINITY; goto set; default: n = limit; |