summaryrefslogtreecommitdiffstats
path: root/sys-utils/prlimit.c
diff options
context:
space:
mode:
authorKarel Zak2011-11-16 10:54:07 +0100
committerKarel Zak2011-11-16 10:54:07 +0100
commitf88e44be572d255d4b67843ae1cb32da3409bf8e (patch)
treefed30638c67d2f2a6b414f3eb172a0f2caf2398e /sys-utils/prlimit.c
parentprlimit: show all limits if called without options (diff)
downloadkernel-qcow2-util-linux-f88e44be572d255d4b67843ae1cb32da3409bf8e.tar.gz
kernel-qcow2-util-linux-f88e44be572d255d4b67843ae1cb32da3409bf8e.tar.xz
kernel-qcow2-util-linux-f88e44be572d255d4b67843ae1cb32da3409bf8e.zip
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 <mail@bernhard-voelker.de> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/prlimit.c')
-rw-r--r--sys-utils/prlimit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys-utils/prlimit.c b/sys-utils/prlimit.c
index fed4f382c..02e520a3b 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)