* fhandler.cc (fhandler_base::set_no_inheritance): Always use
SetHandleInformation. * fhandler_disk_file.cc (fhandler_disk_file::lock): Always use UnlockFileEx/LockFileEx functions. * net.cc (fdsock): Don't bother to duplicate socket for inheritance. * sysconf.cc (get_nproc_values): Take NT for granted. (get_avphys): Ditto. * syslog.cc (WIN95_EVENT_LOG_PATH): Remove define. (get_win95_event_log_path): Remove. (vsyslog): Fix formatting. Take NT for granted. * wincap.cc: Remove has_lock_file_ex, has_signal_object_and_wait, has_eventlog, has_set_handle_information, has_set_handle_information_on_console_handles and supports_smp throughout. * wincap.h: Ditto.
This commit is contained in:
@ -1481,21 +1481,9 @@ fhandler_dev_null::open (int flags, mode_t mode)
|
||||
void
|
||||
fhandler_base::set_no_inheritance (HANDLE &h, bool not_inheriting)
|
||||
{
|
||||
if (wincap.has_set_handle_information ())
|
||||
{
|
||||
if (!SetHandleInformation (h, HANDLE_FLAG_INHERIT, not_inheriting ? 0 : HANDLE_FLAG_INHERIT))
|
||||
debug_printf ("SetHandleInformation failed, %E");
|
||||
}
|
||||
else
|
||||
{
|
||||
HANDLE oh = h;
|
||||
if (!DuplicateHandle (hMainProc, oh, hMainProc, &h, 0, !not_inheriting,
|
||||
DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE))
|
||||
debug_printf ("DuplicateHandle failed, %E");
|
||||
|
||||
if (oh != h)
|
||||
VerifyHandle (h);
|
||||
}
|
||||
if (!SetHandleInformation (h, HANDLE_FLAG_INHERIT,
|
||||
not_inheriting ? 0 : HANDLE_FLAG_INHERIT))
|
||||
debug_printf ("SetHandleInformation failed, %E");
|
||||
#ifdef DEBUGGING_AND_FDS_PROTECTED
|
||||
if (h)
|
||||
setclexec (oh, h, not_inheriting);
|
||||
|
Reference in New Issue
Block a user