* PATCH: ulimit -aH
@ 2004-02-08 21:02 Peter Stephenson
0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 2004-02-08 21:02 UTC (permalink / raw)
To: Zsh hackers list
`ulimit -aH' gives an error message. This is presumably an oversight.
Index: Src/Builtins/rlimits.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Builtins/rlimits.c,v
retrieving revision 1.9
diff -u -r1.9 rlimits.c
--- Src/Builtins/rlimits.c 3 Apr 2003 09:55:49 -0000 1.9
+++ Src/Builtins/rlimits.c 8 Feb 2004 20:49:55 -0000
@@ -462,7 +462,7 @@
static int
bin_ulimit(char *name, char **argv, Options ops, int func)
{
- int res, resmask = 0, hard = 0, soft = 0, nres = 0;
+ int res, resmask = 0, hard = 0, soft = 0, nres = 0, all = 0;
char *options;
do {
@@ -486,11 +486,12 @@
soft = 1;
continue;
case 'a':
- if (*argv || options[1] || resmask) {
- zwarnnam(name, "no arguments required after -a",
+ if (resmask) {
+ zwarnnam(name, "no limits allowed with -a",
NULL, 0);
return 1;
}
+ all = 1;
resmask = (1 << RLIM_NLIMITS) - 1;
nres = RLIM_NLIMITS;
continue;
@@ -547,6 +548,11 @@
resmask |= 1 << res;
nres++;
}
+ if (all && res != -1) {
+ zwarnnam(name, "no limits allowed with -a",
+ NULL, 0);
+ return 1;
+ }
}
}
if (!*argv || **argv == '-') {
@@ -560,6 +566,10 @@
nres++;
continue;
}
+ if (all) {
+ zwarnnam(name, "no arguments allowed after -a", NULL, 0);
+ return 1;
+ }
if (res < 0)
res = RLIMIT_FSIZE;
if (strcmp(*argv, "unlimited")) {
--
Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
Work: pws@csr.com
Web: http://www.pwstephenson.fsnet.co.uk
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-02-08 21:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-08 21:02 PATCH: ulimit -aH Peter Stephenson
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).