Changeset 2450

Show
Ignore:
Timestamp:
01/10/07 20:27:56 (2 years ago)
Author:
dhozac
Message:

The new method doesn't need to be a spectator, and /proc/virtual isn't available there by default.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/vserver-stat.c

    r2449 r2450  
    614614  if (pagesize==0x42) initPageSize(); 
    615615   
    616   my_pid = getpid(); 
    617  
    618   if (!switchToWatchXid(&errptr)) { 
    619     perror(errptr); 
    620     exit(1); 
    621   } 
    622  
    623   if (access("/proc/uptime",R_OK)==-1 && errno==ENOENT) 
    624     WRITE_MSG(2, 
    625               "WARNING: can not access /proc/uptime. Usually, this is caused by\n" 
    626               "         procfs-security. Please read the FAQ for more details\n" 
    627               "         http://linux-vserver.org/Proc-Security\n"); 
    628  
    629616  Vector_init(&xid_data, sizeof(struct XidData)); 
    630617 
     
    642629  } 
    643630  else { 
     631    my_pid = getpid(); 
     632 
     633    if (!switchToWatchXid(&errptr)) { 
     634      perror(errptr); 
     635      exit(1); 
     636    } 
     637 
     638    if (access("/proc/uptime",R_OK)==-1 && errno==ENOENT) 
     639      WRITE_MSG(2, 
     640              "WARNING: can not access /proc/uptime. Usually, this is caused by\n" 
     641              "         procfs-security. Please read the FAQ for more details\n" 
     642              "         http://linux-vserver.org/Proc-Security\n"); 
     643 
    644644    Echdir(PROC_DIR_NAME); 
    645645    proc_dir = Eopendir(".");