From 5549acb31ddf137e225528bee15dd02c842915b5 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Fri, 20 Feb 2004 19:35:50 +0000 Subject: [PATCH] * changed logic to skip entries without chance for success (backported from HEAD) * fixed '--help' message * give vc_set_rlimit() the context instead of a static '-2' * require a ctx on the CLI git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/branches/SYSCALL_SWITCH@979 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/src/vlimit.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/util-vserver/src/vlimit.c b/util-vserver/src/vlimit.c index 6d0a9da..45134d6 100644 --- a/util-vserver/src/vlimit.c +++ b/util-vserver/src/vlimit.c @@ -74,7 +74,7 @@ showHelp(int fd, char const *cmd, int res) WRITE_MSG(fd, "Usage: "); WRITE_STR(fd, cmd); WRITE_MSG(fd, - " [-c|--ctx ] [-a|--all] [-MSH -- ]*\n" + " -c [-a|--all] [-MSH -- ]*\n" "Please report bugs to " PACKAGE_BUGREPORT "\n"); exit(res); } @@ -123,9 +123,9 @@ showAll(int ctx) struct vc_rlimit_mask mask; size_t i; - if (vc_get_rlimit_mask(-2, &mask)==-1) { + if (vc_get_rlimit_mask(ctx, &mask)==-1) { perror("vc_get_rlimit_mask()"); - //exit(1); + exit(1); } for (i=0; i<32; ++i) { @@ -133,6 +133,7 @@ showAll(int ctx) struct vc_rlimit limit; char buf[100], *ptr=buf; + if (((mask.min|mask.soft|mask.hard) & bitmask)==0) continue; if (vc_get_rlimit(ctx, i, &limit)==-1) { perror("vc_get_rlimit()"); //continue; @@ -157,7 +158,7 @@ static void size_t i; for (i=0; i<32; ++i) { if ((mask & (1<