* 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:
parent
fc0ac9dfe6
commit
1b557b4333
|
@ -1,3 +1,11 @@
|
|||
2004-04-20 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* 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.
|
||||
|
||||
2004-04-20 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* fhandler.cc (fhandler_base::open): Add FILE_READ_ATTRIBUTES when
|
||||
|
|
|
@ -607,11 +607,7 @@ fhandler_base::open (int flags, mode_t mode)
|
|||
access = GENERIC_WRITE | FILE_READ_ATTRIBUTES;
|
||||
else
|
||||
access = GENERIC_READ | GENERIC_WRITE;
|
||||
/* Allow reliable lseek on disk devices. */
|
||||
if (get_major () == DEV_FLOPPY_MAJOR)
|
||||
access |= GENERIC_READ;
|
||||
else if (get_major () != DEV_SERIAL_MAJOR
|
||||
&& get_major () != DEV_TAPE_MAJOR)
|
||||
if (get_major () != DEV_SERIAL_MAJOR && get_major () != DEV_TAPE_MAJOR)
|
||||
{
|
||||
create_options |= FILE_SYNCHRONOUS_IO_NONALERT;
|
||||
access |= SYNCHRONIZE;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1364,6 +1364,7 @@ fhandler_dev_tape::raw_write (const void *ptr, size_t len)
|
|||
if (!mt_evt && !(mt_evt = CreateEvent (&sec_none, TRUE, FALSE, NULL)))
|
||||
debug_printf ("Creating event failed: %E");
|
||||
int ret = mt->drive (driveno ())->write (get_handle (), mt_evt, ptr, len);
|
||||
if (ret)
|
||||
__seterrno_from_win_error (ret);
|
||||
return unlock (len);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue