aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-01-05 03:01:30 +0000
committerChristopher Faylor <me@cgf.cx>2003-01-05 03:01:30 +0000
commit87831c1ff36b4571a770b6bd715262ddd21a307c (patch)
tree00db9142ed42e85056e92d94f56a0d7600e4dfbc
parent87fe36eee4da28401230239904900dd6759fe66d (diff)
downloadnewlib-github/unlabeled-1.238.4.zip
newlib-github/unlabeled-1.238.4.tar.gz
newlib-github/unlabeled-1.238.4.tar.bz2
Replace is_fs_device with is_fs_special throughout.github/unlabeled-1.238.4unlabeled-1.238.4
* 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.
-rw-r--r--winsup/cygwin/syscalls.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index f512c05..b541725 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -536,7 +536,7 @@ open (const char *unix_path, int flags, ...)
if (!(fh = cygheap->fdtab.build_fhandler_from_name (fd, unix_path,
NULL, pc)))
res = -1; // errno already set
- else if (fh->is_fs_device () && fh->device_access_denied (flags))
+ else if (fh->is_fs_special () && fh->device_access_denied (flags))
{
fd.release ();
res = -1;
@@ -934,7 +934,7 @@ chmod (const char *path, mode_t mode)
res = 0;
goto done;
}
- if (win32_path.is_fs_device ())
+ if (win32_path.is_fs_special ())
{
res = chmod_device (win32_path, mode);
goto done;
@@ -1972,11 +1972,17 @@ mknod (const char *path, mode_t mode, dev_t dev)
}
mode_t type = mode & S_IFMT;
+ _major_t major = dev >> 8 /* SIGH. _major (dev) */;
+ _minor_t minor = dev & 0xff /* SIGH _minor (dev) */;
switch (type)
{
case S_IFCHR:
case S_IFBLK:
+ break;
+
case S_IFIFO:
+ major = _major (FH_FIFO);
+ minor = _minor (FH_FIFO) & 0xff; /* SIGH again */
break;
case 0:
@@ -1994,8 +2000,6 @@ mknod (const char *path, mode_t mode, dev_t dev)
return -1;
}
- _major_t major = dev >> 8 /* SIGH. _major (dev) */;
- _minor_t minor = dev & 0xff /* SIGH _minor (dev) */;
return mknod_worker (w32path, type, mode, major, minor);
}