diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2007-12-04 16:29:44 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2007-12-04 16:29:44 +0300 |
commit | 86a1bb43f57dee2ed5d3273624475852bb0bf8dd (patch) | |
tree | 6b723e7e0c9a0a05afabb9663e7a63e0ea2e8ba8 /winsup/cygwin/fhandler_fifo.cc | |
parent | 41d46fe86f66a763ca737508ef7123e47a7dce1e (diff) |
* fhandler_fifo.cc (fhandler_fifo::open): Use MAX_NAME for pipe name
buffer size.
(fhandler_fifo::fstatvfs): Use same technique as in fhandler_socket.
* fhandler_proc.cc (format_proc_partitions): Use NAME_MAX+1 for
device name buffer size. Use MAX_PATH for device path buffer size.
Diffstat (limited to 'winsup/cygwin/fhandler_fifo.cc')
-rw-r--r-- | winsup/cygwin/fhandler_fifo.cc | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc index 668c4e2f7..cd8e5c0d3 100644 --- a/winsup/cygwin/fhandler_fifo.cc +++ b/winsup/cygwin/fhandler_fifo.cc @@ -65,7 +65,7 @@ int fhandler_fifo::open (int flags, mode_t) { int res; - char npname[CYG_MAX_PATH]; + char npname[MAX_PATH]; DWORD mode = 0; /* Generate a semi-unique name to associate with this fifo. @@ -164,14 +164,7 @@ fhandler_fifo::write (const void *ptr, size_t len) int __stdcall fhandler_fifo::fstatvfs (struct statvfs *sfs) { - /* Call statvfs on parent dir. */ - char *c, dir[CYG_MAX_PATH]; - strcpy (dir, get_name ()); - if ((c = strrchr (dir, '/'))) - { - *c = '\0'; - return statvfs (dir, sfs); - } - set_errno (EBADF); - return -1; + fhandler_disk_file fh (pc); + fh.get_device () = FH_FS; + return fh.fstatvfs (sfs); } |