Remove unneeded whitespace.
* fhandler_fifo.cc (fhandler_fifo::open): Rework to cause errno to be set to ENXIO when opening a fifo write/nonblocking. * environ.cc (ucreqenv): Rename to ucenv. Move code from old ucenv here and conditionalize it on create_upcaseenv. (ucenv): Delete. (environ_init): Fix compiler warning by moving create_upcaseenv test to ucenv. Don't bother checking for child_proc_info when calling ucenv since it is assumed to be NULL at the point where the function is called. * path.cc (symlink_worker): Turn off MS-DOS path warnings when dealing with devices since the device handler passes in a translated MS-DOS path. * sec_auth.cc (lsaprivkeyauth): Avoid variable initialization which causes a compiler error. * fhandler_netdrive.cc: Update copyright.
This commit is contained in:
@@ -86,13 +86,26 @@ fhandler_fifo::open (int flags, mode_t)
|
||||
LPSECURITY_ATTRIBUTES sa_buf =
|
||||
sec_user ((PSECURITY_ATTRIBUTES) char_sa_buf, cygheap->user.sid());
|
||||
mode |= FILE_FLAG_OVERLAPPED;
|
||||
HANDLE h = CreateNamedPipe(npname, mode, FIFO_PIPE_MODE,
|
||||
PIPE_UNLIMITED_INSTANCES, 0, 0,
|
||||
NMPWAIT_WAIT_FOREVER, sa_buf);
|
||||
|
||||
HANDLE h;
|
||||
DWORD err;
|
||||
bool nonblocking_write = !!((flags & (O_WRONLY | O_NONBLOCK)) == (O_WRONLY | O_NONBLOCK));
|
||||
if (nonblocking_write)
|
||||
{
|
||||
h = INVALID_HANDLE_VALUE;
|
||||
err = ERROR_ACCESS_DENIED;
|
||||
}
|
||||
else
|
||||
{
|
||||
h = CreateNamedPipe(npname, mode, FIFO_PIPE_MODE,
|
||||
PIPE_UNLIMITED_INSTANCES, 0, 0,
|
||||
NMPWAIT_WAIT_FOREVER, sa_buf);
|
||||
err = GetLastError ();
|
||||
}
|
||||
if (h != INVALID_HANDLE_VALUE)
|
||||
wait_state = fifo_wait_for_client;
|
||||
else
|
||||
switch (GetLastError ())
|
||||
switch (err)
|
||||
{
|
||||
case ERROR_ACCESS_DENIED:
|
||||
h = open_nonserver (npname, low_flags, sa_buf);
|
||||
@@ -101,6 +114,11 @@ fhandler_fifo::open (int flags, mode_t)
|
||||
wait_state = fifo_wait_for_server;
|
||||
break;
|
||||
}
|
||||
if (nonblocking_write && GetLastError () == ERROR_FILE_NOT_FOUND)
|
||||
{
|
||||
set_errno (ENXIO);
|
||||
break;
|
||||
}
|
||||
/* fall through intentionally */
|
||||
default:
|
||||
__seterrno ();
|
||||
|
Reference in New Issue
Block a user