Skip to contentSkip to conversation

prlimit: enhance diagnostic when changing a limit fails: add limit name

PATCH Applied Bernhard Voelker 2 participants 2 messages Nov 14, 2011 – Nov 16, 2011 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 6/15 prlimit: enhance diagnostic when changing a limit fails: add limit name

[PATCH 06/15] prlimit: enhance diagnostic when changing a limit fails: add limit name

---
 sys-utils/prlimit.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
sys-utils/prlimit.c +8 -4
index d668fba..611f3e8 100644
@@ -326,14 +326,18 @@ static void do_prlimit(struct prlimit lims[], size_t n, int tt_flags)
 		if (prlimit(pid, lims[i].desc->resource, new, &lims[i].rlim) == -1) {
 			if (pid) {
 				if (lims[i].modify)
-					err(EXIT_FAILURE, _("failed to set resource limits for PID %d"), pid);
+					err(EXIT_FAILURE, _("failed to set the %s resource limit for PID %d"),
+						lims[i].desc->name, pid);
 				else
-					err(EXIT_FAILURE, _("failed to get resource limits for PID %d"), pid);
+					err(EXIT_FAILURE, _("failed to get the %s resource limit for PID %d"),
+						lims[i].desc->name, pid);
 			} else {
 				if (lims[i].modify)
-					err(EXIT_FAILURE, _("failed to set resource limits of the current process"));
+					err(EXIT_FAILURE, _("failed to set the %s resource limit of the current process"),
+						lims[i].desc->name);
 				else
-					err(EXIT_FAILURE, _("failed to get resource limits of the current process"));
+					err(EXIT_FAILURE, _("failed to get the %s resource limit of the current process"),
+						lims[i].desc->name);
 			}
 		}
 	}
maintainer
#1 lore raw
Quoted 2 lines · Bernhard Voelker

[PATCH 06/15] prlimit: enhance diagnostic when changing a limit fails:
add limit name

Good idea, merged with another patch and applied.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com