]> granicus.if.org Git - procps-ng/commitdiff
libproc buffer extension, better w guess
authorcsmall <>
Wed, 15 May 2002 12:54:32 +0000 (12:54 +0000)
committercsmall <>
Wed, 15 May 2002 12:54:32 +0000 (12:54 +0000)
ChangeLog
proc/readproc.c
w.c

index 2a38f8d758006b422a729025b5da15160d501d53..7e0aad61588371facf26fcab5f51577ea43e0981 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 Version ????
 
+    uptime give help if you use invalid chars Debian #93490
+
        /proc/tty/drivers correctly parsed. Debian #108654
        (Thanks russell*AT*coker.com.au)
 
@@ -11,4 +13,9 @@ Version ????
        ps no longer crashes if System.map is %1024. Debian #109237
        (Thanks Colin Walters)
 
+       libproc self buffer increased from 512 to 1024 bytes for
+       large number of groups. Debian #145085, #85775
+
+       w guesses the best process for the user better, good for samba and
+       some xdm session problems Debian #88758 (Thanks Eloy)
 
index 54392381880054e365832b00a1a741d7d7f8921f..91617f3aa157fb0be65700b81b7c671f57b2b606 100644 (file)
@@ -470,7 +470,7 @@ next_proc:                          /* get next PID for consideration */
 
 
 void look_up_our_self(proc_t *p) {
-    static char path[32], sbuf[512];   /* bufs for stat,statm */
+    static char path[32], sbuf[1024];  /* bufs for stat,statm */
     sprintf(path, "/proc/%d", getpid());
     file2str(path, "stat", sbuf, sizeof sbuf);
     stat2proc(sbuf, p);                                /* parse /proc/#/stat */
diff --git a/w.c b/w.c
index 47d7f1296e6d34fc9e83e967ee4f9bdb9b722385..1ec2613632e555539d0772ba18645f89a9afdd94 100644 (file)
--- a/w.c
+++ b/w.c
@@ -146,7 +146,10 @@ static proc_t *getproc(utmp_t *u, char *tty, int *jcpu, int *found_utpid) {
     line = tty_to_dev(tty);
     *jcpu = *found_utpid = 0;
     for(p = procs; *p; p++) {
-       if((**p).pid == u->ut_pid)   *found_utpid = 1;
+       if((**p).pid == u->ut_pid) {
+        *found_utpid = 1;
+        best = *p;
+    }
        if((**p).tty != line) continue;
         (*jcpu) += (**p).utime + (**p).stime;
         secondbest = *p;