* sigproc.h (signal_fixup_after_exec): Eliminate argument in declaration.

* exceptions.cc (signal_fixup_after_exec): Eliminate argument in definition.
Don't reset signal handlers after spawm.  Just treat like fork/exec.
* dcrt0.cc (dll_crt0_1): Don't pass PROC_SPAWN argument to
signal_fixup_after_exec.
* syscalls.cc (unlink): Don't change attributes of file if not readonly/system.
Ditto for resetting of arguments.
This commit is contained in:
Christopher Faylor 2003-03-20 01:34:53 +00:00
parent 8e3121c535
commit 4da34970de
5 changed files with 30 additions and 11 deletions

View File

@ -1,3 +1,14 @@
2003-03-19 Christopher Faylor <cgf@redhat.com>
* sigproc.h (signal_fixup_after_exec): Eliminate argument in declaration.
* exceptions.cc (signal_fixup_after_exec): Eliminate argument in
definition. Don't reset signal handlers after spawm. Just treat like
fork/exec.
* dcrt0.cc (dll_crt0_1): Don't pass PROC_SPAWN argument to
signal_fixup_after_exec.
* syscalls.cc (unlink): Don't change attributes of file if not readonly/system.
Ditto for resetting of arguments.
2003-03-19 Corinna Vinschen <corinna@vinschen.de>
* glob.c: Eliminate __INSIDE_CYGWIN__ preprocessor conditionals

View File

@ -612,7 +612,7 @@ dll_crt0_1 ()
envp = spawn_info->moreinfo->envp;
envc = spawn_info->moreinfo->envc;
cygheap->fdtab.fixup_after_exec (spawn_info->parent);
signal_fixup_after_exec (child_proc_info->type == PROC_SPAWN);
signal_fixup_after_exec ();
CloseHandle (spawn_info->parent);
if (spawn_info->moreinfo->old_title)
{

View File

@ -735,13 +735,13 @@ signal_fixup_after_fork ()
}
void __stdcall
signal_fixup_after_exec (bool isspawn)
signal_fixup_after_exec ()
{
/* Set up child's signal handlers */
for (int i = 0; i < NSIG; i++)
{
myself->getsig (i).sa_mask = 0;
if (myself->getsig (i).sa_handler != SIG_IGN || isspawn)
if (myself->getsig (i).sa_handler != SIG_IGN)
myself->getsig (i).sa_handler = SIG_DFL;
}
}

View File

@ -118,7 +118,7 @@ BOOL __stdcall pid_exists (pid_t) __attribute__ ((regparm(1)));
int __stdcall sig_send (_pinfo *, int, DWORD ebp = (DWORD) __builtin_frame_address (0),
bool exception = 0) __attribute__ ((regparm(3)));
void __stdcall signal_fixup_after_fork ();
void __stdcall signal_fixup_after_exec (bool);
void __stdcall signal_fixup_after_exec ();
void __stdcall wait_for_sigthread ();
extern char myself_nowait_dummy[];

View File

@ -146,8 +146,15 @@ unlink (const char *ourname)
goto done;
}
bool setattrs;
if (!((DWORD) win32_name & (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM)))
setattrs = false;
else
{
/* Allow us to delete even if read-only */
SetFileAttributes (win32_name, (DWORD) win32_name & ~(FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM));
setattrs = true;
}
/* Attempt to use "delete on close" semantics to handle removing
a file which may be open. */
HANDLE h;
@ -155,12 +162,12 @@ unlink (const char *ourname)
OPEN_EXISTING, FILE_FLAG_DELETE_ON_CLOSE, 0);
if (h != INVALID_HANDLE_VALUE)
{
if (wincap.has_hard_links () && setattrs)
(void) SetFileAttributes (win32_name, (DWORD) win32_name);
BOOL res = CloseHandle (h);
syscall_printf ("%d = CloseHandle (%p)", res, h);
if (!win32_name.isremote ()
|| (GetFileAttributes (win32_name) == INVALID_FILE_ATTRIBUTES
|| wincap.has_delete_on_close ()))
if (GetFileAttributes (win32_name) == INVALID_FILE_ATTRIBUTES
|| !win32_name.isremote ())
{
syscall_printf ("CreateFile (FILE_FLAG_DELETE_ON_CLOSE) succeeded");
goto ok;
@ -168,6 +175,7 @@ unlink (const char *ourname)
else
{
syscall_printf ("CreateFile (FILE_FLAG_DELETE_ON_CLOSE) failed");
if (setattrs)
SetFileAttributes (win32_name, (DWORD) win32_name & ~(FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM));
}
}