summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/syscalls.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2009-06-30 21:18:44 +0000
committerChristopher Faylor <me@cgf.cx>2009-06-30 21:18:44 +0000
commitb4fa8164748f263f152f8ec26bf361fa2d364737 (patch)
treecface150f510c4525d88eb186c897f8a81859fb8 /winsup/cygwin/syscalls.cc
parent840bb397986fa6914a67e62e25df97e1dd88dc45 (diff)
downloadcygnal-b4fa8164748f263f152f8ec26bf361fa2d364737.tar.gz
cygnal-b4fa8164748f263f152f8ec26bf361fa2d364737.tar.bz2
cygnal-b4fa8164748f263f152f8ec26bf361fa2d364737.zip
* select.h: New file split from fhandler.h.
(select_record::select_record): Define do-nothing constructor for "new" to avoid gratuitous zeroing. (select_info): New base class. (select_pipe_info): New class with methods for dealing with pipes. (select_socket_info): New class with methods for dealing with sockets. (select_serial_info): Dummy class for serial. (select_mailslot_info): Dummy class for mailslots. (select_stuff): Define device_specific_* as actual classes rather than void *. * dtable.h (dtable::select_read): Accommodate return value change to 'bool' and argument change to "select_stuff". (dtable::select_write): Ditto. (dtable::select_except): Ditto. * dtable.cc (dtable::select_read): Accommodate return value change to 'bool' and argument change to "select_stuff". (dtable::select_write): Ditto. (dtable::select_except): Ditto. * fhandler.h: Excise select-related classes. (fhandler_*::select_read): Change argument to select_stuff. (fhandler_*::select_write): Ditto. (fhandler_*::select_except): Ditto. * select.cc (UNIX_FD_ZERO): Use memset rather than bzero. (select_stuff::test_and_set): Change return type to bool. Allocate select_record on entry and let fhandler_*::select_* operate on the start.next field of select_stuff. (pipeinf): Delete. (select_pipe_info::select_pipe_info): New constructor. Allocates event for controlling pipe waits. (select_pipe_info::~select_pipe_info): New destructor. Destroy event. Stop thread. (select_pipe_info::add_watch_handle): New function. (thread_pipe): Wait for the hEvent part of any overlapped pipes before peeking. (start_thread_pipe): Don't allocate device_specific_pipe stuff here. Assume that it has been allocated earlier. (pipe_cleanup): Rely on select_pipe_info destructor to clean up pipe paraphenalia. (fhandler_*::select_*): Derive select_record from new select_stuff argument. (fhandler_pipe::select_*): Ditto. Allocate pipe-specific field if not already allocated. (serialinf): Delete. (thread_serial): serialinf -> select_serial_info. (fhandler_base::ready_for_read): Rewrite to accommodate change in argument to fhandler_*::select_*. (socketinf): Delete. (thread_socket): socketinf -> select_socket_info. (mailslotinf): Delete. (thread_mailslot): mailslotinf -> select_mailslot_info.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index fa0c607a6..9bfc02c84 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -547,7 +547,7 @@ unlink_nt (path_conv &pc)
way (for instance, font files) by setting the delete disposition fails
with STATUS_CANNOT_DELETE. Strange enough, deleting these hardlinks
using delete-on-close semantic works... most of the time.
-
+
Don't use delete-on-close on remote shares. If two processes
have open handles on a file and one of them calls unlink, the
file is removed from the remote share even though the other
@@ -556,7 +556,7 @@ unlink_nt (path_conv &pc)
Microsoft KB 837665 describes this problem as a bug in 2K3, but
I have reproduced it on other systems. */
if (status == STATUS_CANNOT_DELETE && !pc.isremote ())
- {
+ {
HANDLE fh2;
UNICODE_STRING fname;
@@ -573,11 +573,11 @@ unlink_nt (path_conv &pc)
syscall_printf ("Setting delete-on-close failed, status = %p",
status);
/* This is really the last chance. If it hasn't been moved
- to the bin already, try it now. If moving to the bin
+ to the bin already, try it now. If moving to the bin
succeeds, we got rid of the file in some way, even if
unlinking didn't work. */
if (bin_stat == dont_move)
- bin_stat = try_to_bin (pc, fh, access);
+ bin_stat = try_to_bin (pc, fh, access);
if (bin_stat == has_been_moved)
status = STATUS_SUCCESS;
}
@@ -1563,7 +1563,7 @@ static void
start_transaction (HANDLE &old_trans, HANDLE &trans)
{
NTSTATUS status = NtCreateTransaction (&trans,
- SYNCHRONIZE | TRANSACTION_ALL_ACCESS,
+ SYNCHRONIZE | TRANSACTION_ALL_ACCESS,
NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
if (NT_SUCCESS (status))
{