This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH 08/12] cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::fd
- From: Ken Brown <kbrown at cornell dot edu>
- To: cygwin-patches at cygwin dot com
- Date: Sat, 16 Sep 2017 22:04:16 -0400
- Subject: [PATCH 08/12] cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::fd
- Authentication-results: sourceware.org; auth=none
- References: <20170917020420.10488-1-kbrown@cornell.edu>
Fix all callers.
---
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 7f122fbe4..360d8ea81 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -391,7 +391,7 @@ format_process_fd (void *data, char *&destbuf)
set_errno (ENOENT);
return 0;
}
- destbuf = p->fd (fd, fs);
+ destbuf = p ? p->fd (fd, fs) : NULL;
if (!destbuf || !*destbuf)
{
set_errno (ENOENT);
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 72aa658eb..044c4fc3c 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -832,7 +832,7 @@ char *
_pinfo::fd (int fd, size_t &n)
{
char *s;
- if (!this || !pid)
+ if (!pid)
return NULL;
if (pid != myself->pid)
{
--
2.14.1