From a4e4c8971eaf0e0448d1be21045f6605f57632fd Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Mon, 5 Jan 2004 22:18:36 +0000 Subject: [PATCH] use existing syscall-wrappers instead of checking return-codes manually git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@550 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/src/vserver-stat.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/util-vserver/src/vserver-stat.c b/util-vserver/src/vserver-stat.c index 9c6c398..7e2e029 100644 --- a/util-vserver/src/vserver-stat.c +++ b/util-vserver/src/vserver-stat.c @@ -38,6 +38,8 @@ #include "util.h" #include "internal.h" #include "wrappers.h" +#include "wrappers-dirent.h" +#include "wrappers-vserver.h" #include #include @@ -452,11 +454,7 @@ int main(int argc, char **argv) #if 1 // try to switch in context 1 - if (vc_new_s_context(1,0, 0) < 0) - { - perror("vc_new_s_context(#1,...)"); - return EXIT_FAILURE; - } + Evc_new_s_context(1, 0,0); #endif // create the fist... @@ -464,13 +462,9 @@ int main(int argc, char **argv) // init with the default name for the context 0 strncpy(my_ctx_list->name, "root server", CTX_NAME_MAX_LEN); - // open the /proc dir - if ((proc_dir = opendir(PROC_DIR_NAME)) == NULL) { - perror("opendir()"); - return EXIT_FAILURE; - } - - chdir(PROC_DIR_NAME); + + Echdir(PROC_DIR_NAME); + proc_dir = Eopendir("."); while ((dir_entry = readdir(proc_dir)) != NULL) { // select only process file -- 1.8.1.5