]> sourceware.org Git - newlib-cygwin.git/commitdiff
cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::cwd
authorKen Brown <kbrown@cornell.edu>
Sun, 17 Sep 2017 02:04:12 +0000 (22:04 -0400)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 9 Oct 2017 09:44:11 +0000 (11:44 +0200)
Fix all callers.

winsup/cygwin/fhandler_process.cc
winsup/cygwin/pinfo.cc

index 08cc7ea924ab9a8c6101d86c382bcdb75f5a5d73..453e79b16e33769968771e309f2ad1c406c8c9d4 100644 (file)
@@ -498,7 +498,7 @@ format_process_cwd (void *data, char *&destbuf)
       cfree (destbuf);
       destbuf = NULL;
     }
-  destbuf = p->cwd (fs);
+  destbuf = p ? p->cwd (fs) : NULL;
   if (!destbuf || !*destbuf)
     {
       destbuf = cstrdup ("<defunct>");
index 9fe1b3a88241d42b661490c4f47690f260fada85..c281581684642002521a8b2b2e76977f81486af7 100644 (file)
@@ -930,7 +930,7 @@ char *
 _pinfo::cwd (size_t& n)
 {
   char *s = NULL;
-  if (!this || !pid)
+  if (!pid)
     return NULL;
   if (ISSTATE (this, PID_NOTCYGWIN))
     {
This page took 0.035236 seconds and 5 git commands to generate.