* fhandler.cc (fhandler_base::fstat): Set S_IFIFO for pipes.

* fhandler_socket.cc (fhandler_socket.cc::fstat): Set S_IFSOCK.
This commit is contained in:
Christopher Faylor 2002-06-24 02:23:14 +00:00
parent eecef29f50
commit 035bfbddf5
3 changed files with 19 additions and 5 deletions

View File

@ -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> 2002-06-23 Christopher Faylor <cgf@redhat.com>
* lib/_cygwin_S_IEXEC.cc: Remove obsolete file. * lib/_cygwin_S_IEXEC.cc: Remove obsolete file.

View File

@ -829,18 +829,23 @@ fhandler_base::fstat (struct __stat64 *buf, path_conv *)
{ {
switch (get_device ()) switch (get_device ())
{ {
case FH_PIPE:
buf->st_mode = S_IFIFO | STD_RBITS | STD_WBITS | S_IWGRP | S_IWOTH;
break;
case FH_PIPEW: case FH_PIPEW:
buf->st_mode = STD_WBITS | S_IWGRP | S_IWOTH; buf->st_mode = S_IFIFO | STD_WBITS | S_IWGRP | S_IWOTH;
break; break;
case FH_PIPER: 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; break;
default: 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; break;
} }
buf->st_mode |= get_device () == FH_FLOPPY ? S_IFBLK : S_IFCHR;
buf->st_nlink = 1; buf->st_nlink = 1;
buf->st_blksize = S_BLKSIZE; buf->st_blksize = S_BLKSIZE;
time_as_timestruc_t (&buf->st_ctim); time_as_timestruc_t (&buf->st_ctim);

View File

@ -248,7 +248,11 @@ fhandler_socket::fstat (struct __stat64 *buf, path_conv *pc)
{ {
int res = fhandler_base::fstat (buf, pc); int res = fhandler_base::fstat (buf, pc);
if (!res) if (!res)
{
buf->st_mode &= ~_IFMT;
buf->st_mode |= _IFSOCK;
buf->st_ino = (ino_t) get_handle (); buf->st_ino = (ino_t) get_handle ();
}
return res; return res;
} }