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::fd
- From: Corinna Vinschen <corinna at sourceware dot org>
- To: cygwin-cvs at sourceware dot org
- Date: 9 Oct 2017 10:11:31 -0000
- Subject: [newlib-cygwin] cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::fd
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=6cd1978fc81a2046fa0b27ff63b015f31d49ec77
commit 6cd1978fc81a2046fa0b27ff63b015f31d49ec77
Author: Ken Brown <kbrown@cornell.edu>
Date: Sat Sep 16 22:04:16 2017 -0400
cygwin: Remove comparison of 'this' to 'NULL' in _pinfo::fd
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 7f122fb..360d8ea 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 72aa658..044c4fc 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)
{