From: Karel Zak Date: Wed, 16 Nov 2011 09:54:07 +0000 (+0100) Subject: prlimit: fix error message X-Git-Tag: v2.21-rc1~179 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f88e44be572d255d4b67843ae1cb32da3409bf8e;p=thirdparty%2Futil-linux.git prlimit: fix error message - differentiate between set and get operations - add limit name to the error message - remove PID from the message (whole util works always with only one PID, so this info is superfluous) Reported-by: Bernhard Voelker Signed-off-by: Karel Zak --- diff --git a/sys-utils/prlimit.c b/sys-utils/prlimit.c index fed4f382c2..02e520a3bc 100644 --- a/sys-utils/prlimit.c +++ b/sys-utils/prlimit.c @@ -294,7 +294,6 @@ done: return 0; } - static void do_prlimit(struct prlimit lims[], size_t n, int tt_flags) { size_t i, nshows = 0; @@ -321,7 +320,10 @@ 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) - err(EXIT_FAILURE, _("failed to get resource limits for PID %d"), pid); + err(EXIT_FAILURE, lims[i].modify ? + _("failed to set the %s resource limit") : + _("failed to get the %s resource limit"), + lims[i].desc->name); } if (nshows)