From b25e8b65c27642806ba9f6cc6a75373bdc17c337 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 18 Dec 2004 16:37:44 +0000 Subject: * fhandler_proc.cc (proc_listing): Add entry for "self". (proc_fhandlers): Add entry for "self". * fhandler_process.cc (fhandler_process::fstate): Handle "self". (fhandler_process::open): Handle "self". --- winsup/cygwin/fhandler_process.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'winsup/cygwin/fhandler_process.cc') diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc index e56b85357..004233d3a 100644 --- a/winsup/cygwin/fhandler_process.cc +++ b/winsup/cygwin/fhandler_process.cc @@ -107,7 +107,10 @@ fhandler_process::fstat (struct __stat64 *buf) int file_type = exists (); (void) fhandler_base::fstat (buf); path += proc_len + 1; - pid = atoi (path); + if (path_prefix_p ("self", path, 4)) + pid = getpid (); + else + pid = atoi (path); pinfo p (pid); if (!p) { @@ -167,7 +170,10 @@ fhandler_process::open (int flags, mode_t mode) const char *path; path = get_name () + proc_len + 1; - pid = atoi (path); + if (path_prefix_p ("self", path, 4)) + pid = getpid (); + else + pid = atoi (path); while (*path != 0 && !isdirsep (*path)) path++; @@ -313,7 +319,8 @@ fhandler_process::fill_filebuf () strcpy (filebuf, ""); else { - mount_table->conv_to_posix_path (p->progname, filebuf, 1); + charplus x (p->progname); + mount_table->conv_to_posix_path (x, filebuf, 1); int len = strlen (filebuf); if (len > 4) { -- cgit v1.2.3