From 918f634fed57f28899ec9d2ed1d9922a57ee8cb4 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 21 Jan 2004 18:19:29 +0000 Subject: * fhandler.cc (fhandler_base::open): Use major numbers rather than device numbers to control special behavior for devices which take units. * fhandler_raw.cc (fhandler_dev_raw::writebuf): Ditto. (fhandler_dev_raw::fstat): Ditto. (fhandler_dev_raw::open): Ditto. (fhandler_dev_raw::ioctl): Ditto. --- winsup/cygwin/fhandler.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'winsup/cygwin/fhandler.cc') diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 9be543a06..6d3070992 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -353,7 +353,7 @@ fhandler_base::open (int flags, mode_t mode) if (get_query_open ()) access = 0; - else if (get_device () == FH_TAPE) + else if (get_major () == DEV_TAPE_MAJOR) access = GENERIC_READ | GENERIC_WRITE; else if ((flags & (O_RDONLY | O_WRONLY | O_RDWR)) == O_RDONLY) access = GENERIC_READ; @@ -363,7 +363,7 @@ fhandler_base::open (int flags, mode_t mode) access = GENERIC_READ | GENERIC_WRITE; /* Allow reliable lseek on disk devices. */ - if (get_device () == FH_FLOPPY) + if (get_major () == DEV_FLOPPY_MAJOR) access |= GENERIC_READ; /* FIXME: O_EXCL handling? */ @@ -392,11 +392,11 @@ fhandler_base::open (int flags, mode_t mode) file_attributes = FILE_ATTRIBUTE_NORMAL; if (flags & O_DIROPEN) file_attributes |= FILE_FLAG_BACKUP_SEMANTICS; - if (get_device () == FH_SERIAL) + if (get_major () == DEV_SERIAL_MAJOR) file_attributes |= FILE_FLAG_OVERLAPPED; #ifdef HIDDEN_DOT_FILES - if (flags & O_CREAT && get_device () == FH_FS) + if (flags & O_CREAT && dev ().isfs ()) { char *c = strrchr (get_win32_name (), '\\'); if ((c && c[1] == '.') || *get_win32_name () == '.') @@ -420,7 +420,7 @@ fhandler_base::open (int flags, mode_t mode) /* If the file should actually be created and ntsec is on, set files attributes. */ - if (flags & O_CREAT && get_device () == FH_FS && allow_ntsec && has_acls ()) + if (flags & O_CREAT && dev ().isfs () && allow_ntsec && has_acls ()) set_security_attribute (mode, &sa, sd); x = CreateFile (get_win32_name (), access, shared, &sa, creation_distribution, -- cgit v1.2.3