public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: fix /proc/PID/fd return value in error case
@ 2019-07-22 16:42 Corinna Vinschen
0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2019-07-22 16:42 UTC (permalink / raw)
To: cygwin-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=e118a605e2911b04ff7e239dcbdb737ab4e96c4b
commit e118a605e2911b04ff7e239dcbdb737ab4e96c4b
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Mon Jul 22 18:36:38 2019 +0200
Cygwin: fix /proc/PID/fd return value in error case
commit 2607639992f6 "Improve error handling in /proc/[pid]/
virtual files." changed the return value of the /proc/PID
formatting functions to return -1 instead of 0 in the error
case to allow a filesize of 0.
The patch neglected to change this behaviour for /proc/PID/fd
content. This patch fixes that.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
winsup/cygwin/fhandler_process.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc
index 5ee1293..15c0a41 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -389,13 +389,13 @@ format_process_fd (void *data, char *&destbuf)
if (fd < 0 || e == fdp || (*e != '/' && *e != '\0'))
{
set_errno (ENOENT);
- return 0;
+ return -1;
}
destbuf = p ? p->fd (fd, fs) : NULL;
if (!destbuf || !*destbuf)
{
set_errno (ENOENT);
- return 0;
+ return -1;
}
if (*e == '\0')
*((process_fd_t *) data)->fd_type = virt_fdsymlink;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-07-22 16:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-22 16:42 [newlib-cygwin] Cygwin: fix /proc/PID/fd return value in error case 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).