* 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:
parent
228f6b6e07
commit
c90e1cf179
@ -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>
|
2002-09-21 Conrad Scott <conrad.scott@dsl.pipex.com>
|
||||||
|
|
||||||
* cygwin_ipc.h: Move to "include/cygwin/ipc.h".
|
* cygwin_ipc.h: Move to "include/cygwin/ipc.h".
|
||||||
|
@ -1006,9 +1006,9 @@ fhandler_base::dup (fhandler_base *child)
|
|||||||
debug_printf ("in fhandler_base dup");
|
debug_printf ("in fhandler_base dup");
|
||||||
|
|
||||||
HANDLE nh;
|
HANDLE nh;
|
||||||
if (get_nohandle ())
|
if (!get_nohandle ())
|
||||||
nh = INVALID_HANDLE_VALUE;
|
{
|
||||||
else if (!DuplicateHandle (hMainProc, get_handle(), hMainProc, &nh, 0, TRUE,
|
if (!DuplicateHandle (hMainProc, get_handle (), hMainProc, &nh, 0, TRUE,
|
||||||
DUPLICATE_SAME_ACCESS))
|
DUPLICATE_SAME_ACCESS))
|
||||||
{
|
{
|
||||||
system_printf ("dup(%s) failed, handle %x, %E",
|
system_printf ("dup(%s) failed, handle %x, %E",
|
||||||
@ -1018,6 +1018,7 @@ fhandler_base::dup (fhandler_base *child)
|
|||||||
}
|
}
|
||||||
|
|
||||||
child->set_io_handle (nh);
|
child->set_io_handle (nh);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -541,8 +541,8 @@ fhandler_console::open (path_conv *, int flags, mode_t)
|
|||||||
|
|
||||||
tcinit (get_tty_stuff (flags));
|
tcinit (get_tty_stuff (flags));
|
||||||
|
|
||||||
set_io_handle (INVALID_HANDLE_VALUE);
|
set_io_handle (NULL);
|
||||||
set_output_handle (INVALID_HANDLE_VALUE);
|
set_output_handle (NULL);
|
||||||
|
|
||||||
set_flags ((flags & ~O_TEXT) | O_BINARY);
|
set_flags ((flags & ~O_TEXT) | O_BINARY);
|
||||||
|
|
||||||
@ -595,8 +595,8 @@ fhandler_console::close (void)
|
|||||||
{
|
{
|
||||||
CloseHandle (get_io_handle ());
|
CloseHandle (get_io_handle ());
|
||||||
CloseHandle (get_output_handle ());
|
CloseHandle (get_output_handle ());
|
||||||
set_io_handle (INVALID_HANDLE_VALUE);
|
set_io_handle (NULL);
|
||||||
set_output_handle (INVALID_HANDLE_VALUE);
|
set_output_handle (NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -672,8 +672,9 @@ out:
|
|||||||
|
|
||||||
static
|
static
|
||||||
bool
|
bool
|
||||||
get_mem_values(DWORD dwProcessId, unsigned long *vmsize, unsigned long *vmrss, unsigned long *vmtext,
|
get_mem_values (DWORD dwProcessId, unsigned long *vmsize, unsigned long *vmrss,
|
||||||
unsigned long *vmdata, unsigned long *vmlib, unsigned long *vmshare)
|
unsigned long *vmtext, unsigned long *vmdata,
|
||||||
|
unsigned long *vmlib, unsigned long *vmshare)
|
||||||
{
|
{
|
||||||
bool res = true;
|
bool res = true;
|
||||||
NTSTATUS ret;
|
NTSTATUS ret;
|
||||||
|
@ -35,13 +35,15 @@ WINAPI dll_entry (HANDLE h, DWORD reason, void *static_load)
|
|||||||
case DLL_PROCESS_DETACH:
|
case DLL_PROCESS_DETACH:
|
||||||
break;
|
break;
|
||||||
case DLL_THREAD_DETACH:
|
case DLL_THREAD_DETACH:
|
||||||
pthread *thisthread = (pthread *) TlsGetValue (
|
#if 0
|
||||||
user_data->threadinterface->thread_self_dwTlsIndex);
|
pthread *thisthread = (pthread *)
|
||||||
|
TlsGetValue (user_data->threadinterface->thread_self_dwTlsIndex);
|
||||||
if (thisthread) {
|
if (thisthread) {
|
||||||
/* Some non-pthread call created this thread,
|
/* Some non-pthread call created this thread,
|
||||||
* but we need to clean it up */
|
* but we need to clean it up */
|
||||||
thisthread->exit (0);
|
thisthread->exit (0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -61,8 +61,7 @@ set_myself (pid_t pid, HANDLE h)
|
|||||||
myself->process_state |= PID_IN_USE;
|
myself->process_state |= PID_IN_USE;
|
||||||
myself->start_time = time (NULL); /* Register our starting time. */
|
myself->start_time = time (NULL); /* Register our starting time. */
|
||||||
|
|
||||||
(void) GetModuleFileName (NULL, myself->progname,
|
(void) GetModuleFileName (NULL, myself->progname, sizeof (myself->progname));
|
||||||
sizeof(myself->progname));
|
|
||||||
if (!strace.active)
|
if (!strace.active)
|
||||||
strace.hello ();
|
strace.hello ();
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user