diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-04-20 11:01:22 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-04-20 11:01:22 +0000 |
commit | 1b557b4333fab9dae7bbe9c28798731bc6558dec (patch) | |
tree | 33660387f249d828a90a46ba520c4a6e76294894 /winsup/cygwin/fhandler_raw.cc | |
parent | fc0ac9dfe61d308de80cd36d27b7801fb33eba69 (diff) | |
download | newlib-1b557b4333fab9dae7bbe9c28798731bc6558dec.zip newlib-1b557b4333fab9dae7bbe9c28798731bc6558dec.tar.gz newlib-1b557b4333fab9dae7bbe9c28798731bc6558dec.tar.bz2 |
* fhandler.cc (fhandler_base::open): Remove special DEV_FLOPPY_MAJOR
treatment.
* fhandler_raw.cc (fhandler_dev_raw::open): Simplify write-only case.
* fhandler_tape.cc (fhandler_dev_tape::raw_write): Add accidentally
dropped condition.
Diffstat (limited to 'winsup/cygwin/fhandler_raw.cc')
-rw-r--r-- | winsup/cygwin/fhandler_raw.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/winsup/cygwin/fhandler_raw.cc b/winsup/cygwin/fhandler_raw.cc index 4fafe20..84f657f 100644 --- a/winsup/cygwin/fhandler_raw.cc +++ b/winsup/cygwin/fhandler_raw.cc @@ -144,10 +144,9 @@ fhandler_dev_raw::open (int flags, mode_t) flags &= ~(O_CREAT | O_TRUNC); flags |= O_BINARY; - if (get_major () == DEV_TAPE_MAJOR - || (flags & (O_RDONLY | O_WRONLY | O_RDWR)) == O_WRONLY - || (flags & (O_RDONLY | O_WRONLY | O_RDWR)) == O_RDWR) - flags = ((flags & ~(O_WRONLY | O_RDWR)) | O_RDWR); + /* Write-only doesn't work well with raw devices */ + if ((flags & (O_RDONLY | O_WRONLY | O_RDWR)) == O_WRONLY) + flags = ((flags & ~O_WRONLY) | O_RDWR); int res = fhandler_base::open (flags, 0); if (res && devbufsiz > 1L) |