Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler_process.cc')
-rw-r--r--winsup/cygwin/fhandler_process.cc19
1 files changed, 6 insertions, 13 deletions
diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc
index 3858a2116..35f1c7bb4 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -87,7 +87,7 @@ fhandler_process::exists ()
for (int i = 0; process_listing[i]; i++)
if (pathmatch (path + 1, process_listing[i]))
return -1;
- return 1;
+ return 0;
}
fhandler_process::fhandler_process ():
@@ -104,20 +104,13 @@ fhandler_process::fstat (struct __stat64 *buf, path_conv *pc)
path += proc_len + 1;
int pid = atoi (path);
winpids pids;
- _pinfo *p;
- for (unsigned i = 0; i < pids.npids; i++)
+ pinfo p (pid);
+ if (!p)
{
- p = pids[i];
-
- if (!proc_exists (p))
- continue;
-
- if (p->pid == pid)
- goto found;
+ set_errno(ENOENT);
+ return -1;
}
- set_errno(ENOENT);
- return -1;
-found:
+
buf->st_mode &= ~_IFMT & NO_W;
switch (file_type)