This is the mail archive of the
cygwin-cvs@cygwin.com
mailing list for the Cygwin project.
[newlib-cygwin] cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::fds
- From: Corinna Vinschen <corinna at sourceware dot org>
- To: cygwin-cvs at sourceware dot org
- Date: 9 Oct 2017 10:10:58 -0000
- Subject: [newlib-cygwin] cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::fds
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=504959d8fc5840d90bc8648c5570251616591732
commit 504959d8fc5840d90bc8648c5570251616591732
Author: Ken Brown <kbrown@cornell.edu>
Date: Sat Sep 16 22:04:10 2017 -0400
cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::fds
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 bbb44fa..97436dd 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -375,7 +375,7 @@ format_process_fd (void *data, char *&destbuf)
{
if (destbuf)
cfree (destbuf);
- destbuf = p->fds (fs);
+ destbuf = p ? p->fds (fs) : NULL;
*((process_fd_t *) data)->fd_type = virt_symlink;
}
else
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index a504828..bba9ee4 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -856,7 +856,7 @@ char *
_pinfo::fds (size_t &n)
{
char *s;
- if (!this || !pid)
+ if (!pid)
return NULL;
if (pid != myself->pid)
{