public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::environ
@ 2017-10-09 10:11 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2017-10-09 10:11 UTC (permalink / raw)
  To: cygwin-cvs

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

commit d17c45f200c3b68fe1c99e413b0444366bfd9290
Author: Ken Brown <kbrown@cornell.edu>
Date:   Sat Sep 16 22:04:17 2017 -0400

    cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::environ
    
    Fix all callers.

Diff:
---
 winsup/cygwin/fhandler_process.cc | 2 +-
 winsup/cygwin/pinfo.cc            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc
index 360d8ea..eb5a523 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -583,7 +583,7 @@ format_process_environ (void *data, char *&destbuf)
       cfree (destbuf);
       destbuf = NULL;
     }
-  destbuf = p->environ (fs);
+  destbuf = p ? p->environ (fs) : NULL;
   if (!destbuf || !*destbuf)
     {
       destbuf = cstrdup ("<defunct>");
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 044c4fc..7193f68 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -1036,7 +1036,7 @@ char *
 _pinfo::environ (size_t& n)
 {
   char **env = NULL;
-  if (!this || !pid)
+  if (!pid)
     return NULL;
   if (ISSTATE (this, PID_NOTCYGWIN))
     {


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-09 10:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-09 10:11 [newlib-cygwin] cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::environ Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).