summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Src/Builtins/rlimits.c2
-rw-r--r--Src/exec.c1
3 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3f13a2155..49d53cb46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-10-22  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* 33493: Src/Builtins/rlimits.c, Src/exec.c: use correct command
+	name in error messages about "ulimit" failure; restore internal
+	copy of limits if setrlimit() fails, so the error won't repeat
+
 2014-10-21  Oliver Kiddle  <opk@zsh.org>
 
 	* 33486: Completion/X/Command/_rdesktop: new completion function
diff --git a/Src/Builtins/rlimits.c b/Src/Builtins/rlimits.c
index 9da31831d..85ec1811c 100644
--- a/Src/Builtins/rlimits.c
+++ b/Src/Builtins/rlimits.c
@@ -518,7 +518,7 @@ do_limit(char *nam, int lim, rlim_t val, int hard, int soft, int set)
 		}
 	    } else
 		limits[lim].rlim_cur = val;
-	    if (set && zsetlimit(lim, "limit"))
+	    if (set && zsetlimit(lim, nam))
 		return 1;
 	}
     }
diff --git a/Src/exec.c b/Src/exec.c
index d0fadd69a..2f896d8d5 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -250,6 +250,7 @@ zsetlimit(int limnum, char *nam)
 	if (setrlimit(limnum, limits + limnum)) {
 	    if (nam)
 		zwarnnam(nam, "setrlimit failed: %e", errno);
+	    limits[limnum] = current_limits[limnum];
 	    return -1;
 	}
 	current_limits[limnum] = limits[limnum];