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:
authorChristopher Faylor <me@cgf.cx>2002-06-24 06:23:14 +0400
committerChristopher Faylor <me@cgf.cx>2002-06-24 06:23:14 +0400
commit035bfbddf50a14e58bdae5bf3269bb5440ef0318 (patch)
treef40ff14a69f80fca022a984b7b9d3ec589e928d1
parenteecef29f5043da31a44f4bc197e786e103a8deb8 (diff)
* fhandler.cc (fhandler_base::fstat): Set S_IFIFO for pipes.
* fhandler_socket.cc (fhandler_socket.cc::fstat): Set S_IFSOCK.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/fhandler.cc13
-rw-r--r--winsup/cygwin/fhandler_socket.cc6
3 files changed, 19 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 6f8222a1d..5b5e250ce 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2002-06-23 Conrad Scott <conrad.scott@dsl.pipex.com>
+
+ * fhandler.cc (fhandler_base::fstat): Set S_IFIFO for pipes.
+ * fhandler_socket.cc (fhandler_socket.cc::fstat): Set S_IFSOCK.
+
2002-06-23 Christopher Faylor <cgf@redhat.com>
* lib/_cygwin_S_IEXEC.cc: Remove obsolete file.
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 04156c47c..1b8d4583e 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -829,18 +829,23 @@ fhandler_base::fstat (struct __stat64 *buf, path_conv *)
{
switch (get_device ())
{
+ case FH_PIPE:
+ buf->st_mode = S_IFIFO | STD_RBITS | STD_WBITS | S_IWGRP | S_IWOTH;
+ break;
case FH_PIPEW:
- buf->st_mode = STD_WBITS | S_IWGRP | S_IWOTH;
+ buf->st_mode = S_IFIFO | STD_WBITS | S_IWGRP | S_IWOTH;
break;
case FH_PIPER:
- buf->st_mode = STD_RBITS;
+ buf->st_mode = S_IFIFO | STD_RBITS;
+ break;
+ case FH_FLOPPY:
+ buf->st_mode = S_IFBLK | STD_RBITS | STD_WBITS | S_IWGRP | S_IWOTH;
break;
default:
- buf->st_mode = STD_RBITS | STD_WBITS | S_IWGRP | S_IWOTH;
+ buf->st_mode = S_IFCHR | STD_RBITS | STD_WBITS | S_IWGRP | S_IWOTH;
break;
}
- buf->st_mode |= get_device () == FH_FLOPPY ? S_IFBLK : S_IFCHR;
buf->st_nlink = 1;
buf->st_blksize = S_BLKSIZE;
time_as_timestruc_t (&buf->st_ctim);
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index 3ef35687e..6a6e0eeba 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -248,7 +248,11 @@ fhandler_socket::fstat (struct __stat64 *buf, path_conv *pc)
{
int res = fhandler_base::fstat (buf, pc);
if (!res)
- buf->st_ino = (ino_t) get_handle ();
+ {
+ buf->st_mode &= ~_IFMT;
+ buf->st_mode |= _IFSOCK;
+ buf->st_ino = (ino_t) get_handle ();
+ }
return res;
}