diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2005-09-28 19:02:53 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2005-09-28 19:02:53 +0000 |
commit | 1204c515fe00335920c5707cc136e9562fd7cf38 (patch) | |
tree | 4769da39e77da4b6be69ba926c23e75faa68af82 /winsup/cygwin/pipe.cc | |
parent | 280fdd0b67c3dbd3cee12bf6dbe363f222d98342 (diff) | |
download | cygnal-1204c515fe00335920c5707cc136e9562fd7cf38.tar.gz cygnal-1204c515fe00335920c5707cc136e9562fd7cf38.tar.bz2 cygnal-1204c515fe00335920c5707cc136e9562fd7cf38.zip |
* fhandler.h (class fhandler_dev_raw): Delete current_position and
eof_detected status flag. Delete is_eom and is_eof methods.
Move drive_size, bytes_per_sector, eom_detected status flag, as well
as the methods read_file, write_file, raw_read and raw_write to ...
(class fhandler_dev_floppy): ... here. Remove is_eom and is_eof
methods. Add dup method.
* fhandler_floppy.cc (IS_EOM): New macro.
(fhandler_dev_floppy::is_eom): Remove.
(fhandler_dev_floppy::is_eof): Remove.
(fhandler_dev_floppy::fhandler_dev_floppy): Initialize status flags.
(fhandler_dev_floppy::get_drive_info): Only call EX functions on
systems supporting them and stop suffering strange delays.
(fhandler_dev_floppy::read_file): Move here, drop setting
current_position.
(fhandler_dev_floppy::write_file): Move here, drop setting
current_position.
(fhandler_dev_floppy::open): Rearrange comment.
(fhandler_dev_floppy::dup): New method.
(fhandler_dev_floppy::get_current_position): New inline method. Use
instead of former current_position were appropriate.
(fhandler_dev_floppy::raw_read): Move here. Drop EOF handling.
(fhandler_dev_floppy::raw_write): Move here. Drop EOF handling.
(fhandler_dev_floppy::lseek): Remove useless conditions. Convert
sector_aligned_offset to LARGE_INTEGER to improve SetFilePointer call.
(fhandler_dev_floppy::ioctl): Move blocksize check in RDSETBLK case
to here.
* fhandler_raw.cc (fhandler_dev_raw::is_eom): Remove.
(fhandler_dev_raw::is_eof): Remove.
(fhandler_dev_raw::write_file): Remove.
(fhandler_dev_raw::read_file): Remove.
(fhandler_dev_raw::raw_read): Remove.
(fhandler_dev_raw::raw_write): Remove.
(fhandler_dev_raw::dup): Drop copying removed members.
(fhandler_dev_raw::ioctl): Drop blocksize testing.
* wincap.h: Implement has_disk_ex_ioctls throughout.
* wincap.cc: Ditto.
(wincap_vista): Preliminary wincaps for Windows Vista/Longhorn.
(wincapc::init): Add Vista/Longhorn handling.
Diffstat (limited to 'winsup/cygwin/pipe.cc')
-rw-r--r-- | winsup/cygwin/pipe.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/winsup/cygwin/pipe.cc b/winsup/cygwin/pipe.cc index 3407f0945..eb6287008 100644 --- a/winsup/cygwin/pipe.cc +++ b/winsup/cygwin/pipe.cc @@ -60,7 +60,7 @@ fhandler_pipe::open (int flags, mode_t mode) set_errno (EACCES); return 0; } - if (!cfd->dup (this)) + if (!cfd->dup (this, hMainProc)) return 1; return 0; } @@ -246,7 +246,7 @@ debug_printf ("here"); } int -fhandler_pipe::dup (fhandler_base *child) +fhandler_pipe::dup (fhandler_base *child, HANDLE from_proc) { int res = -1; fhandler_pipe *ftp = (fhandler_pipe *) child; @@ -254,14 +254,14 @@ fhandler_pipe::dup (fhandler_base *child) if (get_handle ()) { - res = fhandler_base::dup (child); + res = fhandler_base::dup (child, from_proc); if (res) goto err; } if (guard == NULL) ftp->guard = NULL; - else if (!DuplicateHandle (hMainProc, guard, hMainProc, &ftp->guard, 0, 1, + else if (!DuplicateHandle (from_proc, guard, hMainProc, &ftp->guard, 0, 1, DUPLICATE_SAME_ACCESS)) { debug_printf ("couldn't duplicate guard %p, %E", guard); @@ -270,7 +270,7 @@ fhandler_pipe::dup (fhandler_base *child) if (writepipe_exists == NULL) ftp->writepipe_exists = NULL; - else if (!DuplicateHandle (hMainProc, writepipe_exists, hMainProc, + else if (!DuplicateHandle (from_proc, writepipe_exists, hMainProc, &ftp->writepipe_exists, 0, 1, DUPLICATE_SAME_ACCESS)) { @@ -280,7 +280,7 @@ fhandler_pipe::dup (fhandler_base *child) if (read_state == NULL) ftp->read_state = NULL; - else if (!DuplicateHandle (hMainProc, read_state, hMainProc, + else if (!DuplicateHandle (from_proc, read_state, hMainProc, &ftp->read_state, 0, 0, DUPLICATE_SAME_ACCESS)) { |