* fhandler.cc (fhandler_base::open): Always add GENERIC_READ access

when opening raw disk devices.
        * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Implement bytewise
        access.
        * fhandler_raw.cc (fhandler_dev_raw::open): Always open raw disk device
        binary.
        (fhandler_dev_raw::raw_write): Don't drop read buffer content when
        writing after read.
This commit is contained in:
Corinna Vinschen
2001-02-05 16:10:06 +00:00
parent cada03f92f
commit ae9b22c69b
4 changed files with 101 additions and 6 deletions

View File

@@ -324,6 +324,12 @@ fhandler_base::open (int flags, mode_t mode)
access_ = GENERIC_READ | GENERIC_WRITE;
}
/* Allow reliable lseek on disk devices. */
if (get_device () == FH_FLOPPY)
{
access_ |= GENERIC_READ;
}
/* FIXME: O_EXCL handling? */
if ((flags & O_TRUNC) && ((flags & O_ACCMODE) != O_RDONLY))