summaryrefslogtreecommitdiffstats
path: root/sys-utils/prlimit.c
diff options
context:
space:
mode:
authorKarel Zak2013-06-10 11:55:52 +0200
committerKarel Zak2013-09-16 16:46:59 +0200
commit1e7708511fbae88d19d00ee7e4eba7e7987ff86a (patch)
tree0af3c0a8aaf4711c41461dd0d8f4b95b57cecfbc /sys-utils/prlimit.c
parentswapon: use TT_FL_FREEDATA for tt table (diff)
downloadkernel-qcow2-util-linux-1e7708511fbae88d19d00ee7e4eba7e7987ff86a.tar.gz
kernel-qcow2-util-linux-1e7708511fbae88d19d00ee7e4eba7e7987ff86a.tar.xz
kernel-qcow2-util-linux-1e7708511fbae88d19d00ee7e4eba7e7987ff86a.zip
prlimit: use TT_FL_FREEDATA for tt table
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/prlimit.c')
-rw-r--r--sys-utils/prlimit.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys-utils/prlimit.c b/sys-utils/prlimit.c
index 6d9ded223..5bb99d1ec 100644
--- a/sys-utils/prlimit.c
+++ b/sys-utils/prlimit.c
@@ -226,20 +226,20 @@ static void add_tt_line(struct tt *tt, struct prlimit *l)
switch (get_column_id(i)) {
case COL_RES:
- xasprintf(&str, "%s", l->desc->name);
+ str = xstrdup(l->desc->name);
break;
case COL_HELP:
- xasprintf(&str, "%s", l->desc->help);
+ str = xstrdup(l->desc->help);
break;
case COL_SOFT:
if (l->rlim.rlim_cur == RLIM_INFINITY)
- xasprintf(&str, "%s", "unlimited");
+ str = xstrdup(_("unlimited"));
else
xasprintf(&str, "%llu", (unsigned long long) l->rlim.rlim_cur);
break;
case COL_HARD:
if (l->rlim.rlim_max == RLIM_INFINITY)
- xasprintf(&str, "%s", "unlimited");
+ str = xstrdup(_("unlimited"));
else
xasprintf(&str, "%llu", (unsigned long long) l->rlim.rlim_max);
break;
@@ -285,7 +285,7 @@ static int show_limits(struct list_head *lims, int tt_flags)
struct list_head *p, *pnext;
struct tt *tt;
- tt = tt_new_table(tt_flags);
+ tt = tt_new_table(tt_flags | TT_FL_FREEDATA);
if (!tt) {
warn(_("failed to initialize output table"));
return -1;