https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=210bd56aa26d8d6f88e6c4566981cdb7835b80b9

commit 210bd56aa26d8d6f88e6c4566981cdb7835b80b9
Author: Corinna Vinschen <[email protected]>
Date:   Fri Feb 1 13:18:15 2019 +0100

    Cygwin: /proc: don't exit prematurely from /proc/PID/status
    
    If a process is just exiting, requesting memory info may fail
    with STATUS_PROCESS_IS_TERMINATING.  Right now the code just bails
    out if fetching mem info fails.  However, the rest of the info is
    still valuable for procps, so just carry on.
    
    Signed-off-by: Corinna Vinschen <[email protected]>

Diff:
---
 winsup/cygwin/fhandler_process.cc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/winsup/cygwin/fhandler_process.cc 
b/winsup/cygwin/fhandler_process.cc
index 24ef7d0..29b8c59 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -1212,9 +1212,8 @@ format_process_status (void *data, char *&destbuf)
       state_str = "stopped";
       break;
     }
-  if (!get_mem_values (p->dwProcessId, vmsize, vmrss, vmtext, vmdata,
-                      vmlib, vmshare))
-    return 0;
+  get_mem_values (p->dwProcessId, vmsize, vmrss, vmtext, vmdata,
+                 vmlib, vmshare);
   /* The real uid value for *this* process is stored at cygheap->user.real_uid
      but we can't get at the real uid value for any other process, so
      just fake it as p->uid.  Similar for p->gid. */

Reply via email to