* 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.
This commit is contained in:
Corinna Vinschen
2004-04-20 11:01:22 +00:00
parent fc0ac9dfe6
commit 1b557b4333
4 changed files with 13 additions and 9 deletions

View File

@ -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)