From b62fe1576311afb7d5cd2120dfc7323875b436d1 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Fri, 20 Feb 2004 20:05:32 +0000 Subject: [PATCH] merged with 0.29.2 git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@982 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/src/vlimit.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/util-vserver/src/vlimit.c b/util-vserver/src/vlimit.c index df552be..0091fc8 100644 --- a/util-vserver/src/vlimit.c +++ b/util-vserver/src/vlimit.c @@ -75,7 +75,7 @@ showHelp(int fd, char const *cmd, int res) WRITE_MSG(fd, "Usage: "); WRITE_STR(fd, cmd); WRITE_MSG(fd, - " [-c ] [-a|--all] [-MSH -- ]*\n" + " -c [-a|--all] [-MSH -- ]*\n" "Please report bugs to " PACKAGE_BUGREPORT "\n"); exit(res); } @@ -122,9 +122,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) { @@ -170,7 +170,7 @@ int main (int argc, char *argv[]) int set_mask = 0; struct vc_rlimit limits[32]; bool show_all = false; - xid_t ctx = VC_SAMECTX; + xid_t ctx = VC_NOCTX; { size_t i; @@ -224,6 +224,11 @@ int main (int argc, char *argv[]) } } + if (ctx==VC_NOCTX) { + WRITE_MSG(2, "No context specified; try '--help' for more information\n"); + return EXIT_FAILURE; + } + setLimits(ctx, limits, lim_mask); if (show_all) showAll(ctx); -- 1.8.1.5