X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fvserver-stat.c;h=9f038713000272fa3edcfdbd86e3012c93f05e6b;hb=7e5c1daf8cff3a0d6a4a81b56bf4cc4f32d25513;hp=efb87063f861764f46c27625f575d8e0e76c82d7;hpb=fc84d2d3d5179f3bbbcee0f7e8d8cb155239edfd;p=util-vserver.git diff --git a/src/vserver-stat.c b/src/vserver-stat.c index efb8706..9f03871 100644 --- a/src/vserver-stat.c +++ b/src/vserver-stat.c @@ -67,9 +67,9 @@ static unsigned long pagesize=0x42; struct XidData { xid_t xid; - int process_count; - int VmSize_total; - int VmRSS_total; + unsigned int process_count; + uint64_t VmSize_total; + uint64_t VmRSS_total; uint64_t start_time_oldest; uint64_t stime_total, utime_total; @@ -613,19 +613,6 @@ int main(int argc, char **argv) if (hertz==0x42) initHertz(); if (pagesize==0x42) initPageSize(); - my_pid = getpid(); - - if (!switchToWatchXid(&errptr)) { - perror(errptr); - exit(1); - } - - if (access("/proc/uptime",R_OK)==-1 && errno==ENOENT) - WRITE_MSG(2, - "WARNING: can not access /proc/uptime. Usually, this is caused by\n" - " procfs-security. Please read the FAQ for more details\n" - " http://linux-vserver.org/Proc-Security\n"); - Vector_init(&xid_data, sizeof(struct XidData)); if (vc_isSupported(vcFEATURE_VSTAT)) { @@ -641,6 +628,19 @@ int main(int argc, char **argv) closedir(proc_dir); } else { + my_pid = getpid(); + + if (!switchToWatchXid(&errptr)) { + perror(errptr); + exit(1); + } + + if (access("/proc/uptime",R_OK)==-1 && errno==ENOENT) + WRITE_MSG(2, + "WARNING: can not access /proc/uptime. Usually, this is caused by\n" + " procfs-security. Please read the FAQ for more details\n" + " http://linux-vserver.org/Proc-Security\n"); + Echdir(PROC_DIR_NAME); proc_dir = Eopendir("."); while ((dir_entry = readdir(proc_dir)) != NULL)