aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2019-07-22 18:36:38 +0200
committerCorinna Vinschen <corinna@vinschen.de>2019-07-22 18:42:38 +0200
commite118a605e2911b04ff7e239dcbdb737ab4e96c4b (patch)
tree5fbde82354eb057956b4f038eccfbcd66471a4db /winsup
parent86817773c575a10d4761977ef12850527b5e04b6 (diff)
downloadnewlib-e118a605e2911b04ff7e239dcbdb737ab4e96c4b.zip
newlib-e118a605e2911b04ff7e239dcbdb737ab4e96c4b.tar.gz
newlib-e118a605e2911b04ff7e239dcbdb737ab4e96c4b.tar.bz2
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>
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/fhandler_process.cc4
1 files 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;