From a3d1d5a98babc915380ee1bf5f8b0ac3f10b4952 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sun, 5 Jan 2003 03:01:26 +0000 Subject: Replace is_fs_device with is_fs_special throughout. * Makefile.in (DLL_OFILES): Add fhandler_fifo.o. * devices.h (fh_devices): Renumber some minor numbers to fit in 8 bits. * dtable.cc (dtable::build_fhandler): Handle FH_FIFO. Set errno to ENODEV if device not found. * dtable::find_fifo: Define new function. * dtable.h (dtable::find_fifo): Declare new function. * fhandler.cc (fhandler_base::device_access_denied): Fix O_RDONLY test. (fhandler_base::write): Use output file handle for writing. (fhandler_base::fstat): Use is_fs_special rather than is_fs_device. * fhandler.h (fhandler_base::is_fs_special): Rename from is_fs_device. (fhandler_pipe): Make private elements protected so that fhandler_fifo can use them too. (fhandler_pipe::create): New function derived from make_pipe. (fhandler_fifo): Add more needed elements. (fhandler_pty_master::slave): Add to track slave device. (fhandler_pty_master::get_unit): Define. * fhandler_tty.cc (fhandler_tty_master::init): Register slave device. (fhandler_pty_master::open): Ditto. (symlink_info::parse_device): Handle fifo specially. * pinfo.cc (_pinfo::commune_recv): Initial fifo implementation. (_pinfo::commune_send): Ditto. * pinfo.h (picom): Add PICOM_FIFO. * pipe.cc (fhandler_pipe::close): Close input handle here specifically. (fhandler_pipe::create): Rename from make_pipe. Create fhandlers rather than fds. (pipe): Use fhandler_pipe::create to create pipe. (_pipe): Ditto. * syscalls.cc (mknod): Accommodate fifos. --- winsup/cygwin/path.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index a6daae950..67a9ed79d 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -97,9 +97,11 @@ class path_conv return 0; } int issymlink () const {return path_flags & PATH_SYMLINK;} - int isdevice () const {return dev.devn && dev.devn != FH_FS;} - int is_auto_device () const {return isdevice () && !is_fs_device ();} - int is_fs_device () const {return isdevice () && dev.isfs ();} + int isdevice () const {return dev.devn && dev.devn != FH_FS && dev.devn != FH_FIFO;} + int isfifo () const {return dev == FH_FIFO;} + int isspecial () const {return dev.devn && dev.devn != FH_FS;} + int is_auto_device () const {return isdevice () && !is_fs_special ();} + int is_fs_special () const {return isspecial () && dev.isfs ();} int issocket () const {return path_flags & PATH_SOCKET;} int iscygexec () const {return path_flags & PATH_CYGWIN_EXEC;} bool exists () const {return fileattr != INVALID_FILE_ATTRIBUTES;} -- cgit v1.2.3