* fhandler.cc (fhandler_base::dup): Don't set handle on failure. Caller has

already taken care of that.
* fhandler_console.cc (fhandler_console::open): Initialize handles to NULL.
(fhandler_console::close): Ditto.  GNUify non-GNU formatted functions calls
throughout.
This commit is contained in:
Christopher Faylor 2002-09-22 03:38:57 +00:00
parent 228f6b6e07
commit c90e1cf179
43 changed files with 250 additions and 235 deletions

View File

@ -1,3 +1,15 @@
2002-09-21 Christopher Faylor <cgf@redhat.com>
* fhandler.cc (fhandler_base::dup): Don't set handle on failure.
Caller has already taken care of that.
* fhandler_console.cc (fhandler_console::open): Initialize handles to
NULL.
(fhandler_console::close): Ditto.
2002-09-21 Christopher Faylor <cgf@redhat.com>
GNUify non-GNU formatted functions calls throughout.
2002-09-21 Conrad Scott <conrad.scott@dsl.pipex.com>
* cygwin_ipc.h: Move to "include/cygwin/ipc.h".

View File

@ -1006,9 +1006,9 @@ fhandler_base::dup (fhandler_base *child)
debug_printf ("in fhandler_base dup");
HANDLE nh;
if (get_nohandle ())
nh = INVALID_HANDLE_VALUE;
else if (!DuplicateHandle (hMainProc, get_handle(), hMainProc, &nh, 0, TRUE,
if (!get_nohandle ())
{
if (!DuplicateHandle (hMainProc, get_handle (), hMainProc, &nh, 0, TRUE,
DUPLICATE_SAME_ACCESS))
{
system_printf ("dup(%s) failed, handle %x, %E",
@ -1018,6 +1018,7 @@ fhandler_base::dup (fhandler_base *child)
}
child->set_io_handle (nh);
}
return 0;
}

View File

@ -541,8 +541,8 @@ fhandler_console::open (path_conv *, int flags, mode_t)
tcinit (get_tty_stuff (flags));
set_io_handle (INVALID_HANDLE_VALUE);
set_output_handle (INVALID_HANDLE_VALUE);
set_io_handle (NULL);
set_output_handle (NULL);
set_flags ((flags & ~O_TEXT) | O_BINARY);
@ -595,8 +595,8 @@ fhandler_console::close (void)
{
CloseHandle (get_io_handle ());
CloseHandle (get_output_handle ());
set_io_handle (INVALID_HANDLE_VALUE);
set_output_handle (INVALID_HANDLE_VALUE);
set_io_handle (NULL);
set_output_handle (NULL);
return 0;
}

View File

@ -672,8 +672,9 @@ out:
static
bool
get_mem_values(DWORD dwProcessId, unsigned long *vmsize, unsigned long *vmrss, unsigned long *vmtext,
unsigned long *vmdata, unsigned long *vmlib, unsigned long *vmshare)
get_mem_values (DWORD dwProcessId, unsigned long *vmsize, unsigned long *vmrss,
unsigned long *vmtext, unsigned long *vmdata,
unsigned long *vmlib, unsigned long *vmshare)
{
bool res = true;
NTSTATUS ret;

View File

@ -35,13 +35,15 @@ WINAPI dll_entry (HANDLE h, DWORD reason, void *static_load)
case DLL_PROCESS_DETACH:
break;
case DLL_THREAD_DETACH:
pthread *thisthread = (pthread *) TlsGetValue (
user_data->threadinterface->thread_self_dwTlsIndex);
#if 0
pthread *thisthread = (pthread *)
TlsGetValue (user_data->threadinterface->thread_self_dwTlsIndex);
if (thisthread) {
/* Some non-pthread call created this thread,
* but we need to clean it up */
thisthread->exit (0);
}
#endif
break;
}
return 1;

View File

@ -61,8 +61,7 @@ set_myself (pid_t pid, HANDLE h)
myself->process_state |= PID_IN_USE;
myself->start_time = time (NULL); /* Register our starting time. */
(void) GetModuleFileName (NULL, myself->progname,
sizeof(myself->progname));
(void) GetModuleFileName (NULL, myself->progname, sizeof (myself->progname));
if (!strace.active)
strace.hello ();
return;