* dcrt0.cc (dlL_crt0_1): Set __argc_safe after __argc is absolutely know to be

set.
* exceptions.cc (sig_handle_tty_stop): Don't reset sigCONT event since it is
reset automatically.
* fork.cc (fork): Remove obsolete usage of PID_SPLIT_HEAP.
* include/sys/cygwin.h: Ditto.
* sigproc.cc (sig_send): Use sigframe init method to set frame since it checks
for previous ownership of the frame.
* sigproc.h (sigframe::init): Accept an "is_exception" argument.
This commit is contained in:
Christopher Faylor 2003-09-09 03:11:31 +00:00
parent 51d340e1c8
commit 3ef50005c7
8 changed files with 24 additions and 22 deletions

View File

@ -1,3 +1,15 @@
2003-09-08 Christopher Faylor <cgf@redhat.com>
* dcrt0.cc (dlL_crt0_1): Set __argc_safe after __argc is absolutely
know to be set.
* exceptions.cc (sig_handle_tty_stop): Don't reset sigCONT event since
it is reset automatically.
* fork.cc (fork): Remove obsolete usage of PID_SPLIT_HEAP.
* include/sys/cygwin.h: Ditto.
* sigproc.cc (sig_send): Use sigframe init method to set frame since it
checks for previous ownership of the frame.
* sigproc.h (sigframe::init): Accept an "is_exception" argument.
2003-09-08 Christopher Faylor <cgf@redhat.com>
* dir.cc (readdir): Reinstate setting of old ino field for legacy

View File

@ -607,7 +607,7 @@ dll_crt0_1 ()
DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE))
h = NULL;
set_myself (mypid, h);
__argc = __argc_safe = spawn_info->moreinfo->argc;
__argc = spawn_info->moreinfo->argc;
__argv = spawn_info->moreinfo->argv;
envp = spawn_info->moreinfo->envp;
envc = spawn_info->moreinfo->envc;
@ -724,6 +724,7 @@ dll_crt0_1 ()
}
}
__argc_safe = __argc;
if (user_data->premain[0])
for (unsigned int i = 0; i < PREMAIN_LEN / 2; i++)
user_data->premain[i] (__argc, __argv, user_data);

View File

@ -618,7 +618,6 @@ sig_handle_tty_stop (int sig)
myself->pid, sig, myself->ppid_handle);
if (WaitForSingleObject (sigCONT, INFINITE) != WAIT_OBJECT_0)
api_fatal ("WaitSingleObject failed, %E");
(void) ResetEvent (sigCONT);
return;
}
}
@ -1048,23 +1047,23 @@ sig_handle (int sig)
goto dosig;
stop:
stop:
/* Eat multiple attempts to STOP */
if (ISSTATE (myself, PID_STOPPED))
goto done;
handler = (void *) sig_handle_tty_stop;
thissig = myself->getsig (SIGSTOP);
dosig:
dosig:
/* Dispatch to the appropriate function. */
sigproc_printf ("signal %d, about to call %p", sig, handler);
rc = setup_handler (sig, handler, thissig);
done:
done:
sigproc_printf ("returning %d", rc);
return rc;
exit_sig:
exit_sig:
if (sig == SIGQUIT || sig == SIGABRT)
{
CONTEXT c;

View File

@ -510,7 +510,7 @@ err:
buflen = (size_t) -1;
return;
sig_exit:
sig_exit:
set_sig_errno (EINTR);
buflen = (size_t) -1;
return;

View File

@ -633,15 +633,6 @@ fork ()
grouped.hParent = grouped.first_dll = NULL;
grouped.load_dlls = 0;
if (ISSTATE(myself, PID_SPLIT_HEAP))
{
system_printf ("The heap has been split, CYGWIN can't fork this process.");
system_printf ("Increase the heap_chunk_size in the registry and try again.");
set_errno (ENOMEM);
syscall_printf ("-1 = fork (), split heap");
return -1;
}
void *esp;
__asm__ volatile ("movl %%esp,%0": "=r" (esp));

View File

@ -89,8 +89,7 @@ enum
PID_ORPHANED = 0x0020, /* Member of an orphaned process group. */
PID_ACTIVE = 0x0040, /* Pid accepts signals. */
PID_CYGPARENT = 0x0080, /* Set if parent was a cygwin app. */
PID_SPLIT_HEAP = 0x0100, /* Set if the heap has been split, */
/* which means we can't fork again. */
PID_UNUSED = 0x0100, /* ... */
PID_MYSELF = 0x0200, /* Flag that pid is me. */
PID_NOCLDSTOP = 0x0400, /* Set if no SIGCHLD signal on stop. */
PID_INITIALIZING = 0x0800, /* Set until ready to receive signals. */

View File

@ -717,7 +717,7 @@ sig_send (_pinfo *p, int sig, DWORD ebp, bool exception)
{
thiscatch = sigcatch_main;
thiscomplete = sigcomplete_main;
thisframe.set (mainthread, ebp, exception);
thisframe.init (mainthread, ebp, exception);
todo = getlocal_sigtodo (sig);
issem = true;
}

View File

@ -75,10 +75,10 @@ public:
if (!oframe)
t.get_winapi_lock ();
}
inline void init (sigthread &t, DWORD ebp = (DWORD) __builtin_frame_address (0))
inline void init (sigthread &t, DWORD ebp = (DWORD) __builtin_frame_address (0), bool is_exception = 0)
{
if (!t.frame && t.id == GetCurrentThreadId ())
set (t, ebp);
if (is_exception || (!t.frame && t.id == GetCurrentThreadId ()))
set (t, ebp, is_exception);
else
st = NULL;
}