X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fsrc%2Fvps.c;h=ead995da4b4b5e3870858a7ca3e1387e7d3b74b1;hb=a917f24ef7b003dcef54a3db2644cf9cb4bc2db2;hp=325beae7502702714e6439aa39d668aa19cc8f95;hpb=4de2215dbcdbe54926661409b9729b45f724b18c;p=util-vserver.git diff --git a/util-vserver/src/vps.c b/util-vserver/src/vps.c index 325beae..ead995d 100644 --- a/util-vserver/src/vps.c +++ b/util-vserver/src/vps.c @@ -21,13 +21,18 @@ #endif #include "util.h" -#include "wrappers.h" -#include "wrappers-vserver.h" #include "pathconfig.h" #include #include #include +#include + +#define ENSC_WRAPPERS_VSERVER 1 +#define ENSC_WRAPPERS_STDLIB 1 +#define ENSC_WRAPPERS_UNISTD 1 +#define ENSC_WRAPPERS_FCNTL 1 +#include #define CTXNR_WIDTH 5 #define HUNK_SIZE 0x4000 @@ -51,7 +56,7 @@ showHelp(int fd, char const *cmd, int res) WRITE_MSG(fd, "Usage: "); WRITE_STR(fd, cmd); WRITE_MSG(fd, - " *\n\n" + " *\n\n" "Please report bugs to " PACKAGE_BUGREPORT "\n"); exit(res); } @@ -62,7 +67,7 @@ showVersion() WRITE_MSG(1, "vps " VERSION " -- shows processes in vserver-contexts\n" "This program is part of " PACKAGE_STRING "\n\n" - "Copyright (C) 2003 Enrico Scholz\n" + "Copyright (C) 2004 Enrico Scholz\n" VERSION_COPYRIGHT_DISCLAIMER); exit(0); } @@ -96,7 +101,7 @@ extractCtx(char *pid_str) while (*pid_str==' ') ++pid_str; pid = atoi(pid_str); - return vc_X_getctx(pid); + return vc_get_task_xid(pid); } static char const * @@ -197,6 +202,7 @@ processOutput(char *data, size_t len) write(1, data, pid_end); l = writeContextInfo(ctx, vserver_name); if (l1) { if (strcmp(argv[1], "--help") ==0) showHelp(1, argv[0], 0); if (strcmp(argv[1], "--version")==0) showVersion(); } - - if (vc_X_getctx(0)!=1) - Evc_new_s_context(1, vc_get_securecaps(), 0); + + if (!switchToWatchXid(&errptr)) { + perror(errptr); + exit(wrapper_exit_code); + } Epipe(p); pid = Efork();