Removed SIGNAL_MaskAsyncEvents and cleaned up signal handling.

This commit is contained in:
Alexandre Julliard 1999-08-01 14:54:16 +00:00
parent beb8fabf22
commit bdf83bc546
4 changed files with 11 additions and 54 deletions

View File

@ -690,15 +690,15 @@ static HANDLER_DEF(EXC_int)
*/
void EXC_InitHandlers(void)
{
SIGNAL_SetHandler( SIGINT, (void (*)())EXC_int, 1 );
SIGNAL_SetHandler( SIGFPE, (void (*)())EXC_fpe, 1 );
SIGNAL_SetHandler( SIGSEGV, (void (*)())EXC_segv, 1 );
SIGNAL_SetHandler( SIGILL, (void (*)())EXC_segv, 1 );
SIGNAL_SetHandler( SIGINT, (void (*)())EXC_int );
SIGNAL_SetHandler( SIGFPE, (void (*)())EXC_fpe );
SIGNAL_SetHandler( SIGSEGV, (void (*)())EXC_segv );
SIGNAL_SetHandler( SIGILL, (void (*)())EXC_segv );
#ifdef SIGBUS
SIGNAL_SetHandler( SIGBUS, (void (*)())EXC_segv, 1 );
SIGNAL_SetHandler( SIGBUS, (void (*)())EXC_segv );
#endif
#ifdef SIGTRAP
SIGNAL_SetHandler( SIGTRAP, (void (*)())EXC_trap, 1 );
SIGNAL_SetHandler( SIGTRAP, (void (*)())EXC_trap );
#endif
return;
}

View File

@ -186,8 +186,7 @@ extern void WINAPI XMS_Handler(CONTEXT86*);
/* loader/signal.c */
extern BOOL SIGNAL_Init(void);
extern void SIGNAL_SetHandler( int sig, void (*func)(), int flags );
extern void SIGNAL_MaskAsyncEvents( BOOL flag );
extern void SIGNAL_SetHandler( int sig, void (*func)() );
/* misc/aspi.c */
extern void ASPI_DOS_HandleInt(CONTEXT86 *context);

View File

@ -423,8 +423,6 @@ BOOL MZ_InitTask( LPDOSTASK lpDosTask )
/* put our pipes somewhere dosmod can find them */
dup2(write_fd[0],0); /* stdin */
dup2(x_fd,1); /* stdout */
/* enable signals */
SIGNAL_MaskAsyncEvents(FALSE);
/* now load dosmod */
/* check argv[0]-derived paths first, since the newest dosmod is most likely there
* (at least it was once for Andreas Mohr, so I decided to make it easier for him) */

View File

@ -87,31 +87,12 @@ static inline int wine_sigaction( int sig, struct kernel_sigaction *new,
/* Signal stack */
static char SIGNAL_Stack[16384];
static sigset_t async_signal_set;
/**********************************************************************
* SIGNAL_child
*
* wait4 terminated child processes
*/
static HANDLER_DEF(SIGNAL_child)
{
HANDLER_INIT();
#ifdef HAVE_WAIT4
wait4( 0, NULL, WNOHANG, NULL);
#elif defined (HAVE_WAITPID)
/* I am sort-of guessing that this is the same as the wait4 call. */
waitpid (0, NULL, WNOHANG);
#else
wait(NULL);
#endif
}
/**********************************************************************
* SIGNAL_SetHandler
*/
void SIGNAL_SetHandler( int sig, void (*func)(), int flags )
void SIGNAL_SetHandler( int sig, void (*func)() )
{
int ret;
@ -119,7 +100,7 @@ void SIGNAL_SetHandler( int sig, void (*func)(), int flags )
struct kernel_sigaction sig_act;
sig_act.sa_handler = func;
sig_act.sa_flags = SA_RESTART | (flags) ? SA_NOMASK : 0;
sig_act.sa_flags = SA_RESTART | SA_NOMASK;
sig_act.sa_mask = 0;
/* Point to the top of the stack, minus 4 just in case, and make
it aligned */
@ -153,19 +134,6 @@ void SIGNAL_SetHandler( int sig, void (*func)(), int flags )
}
}
extern void stop_wait(int a);
extern void WINSOCK_sigio(int a);
extern void ASYNC_sigio(int a);
/**********************************************************************
* SIGNAL_MaskAsyncEvents
*/
void SIGNAL_MaskAsyncEvents( BOOL flag )
{
sigprocmask( (flag) ? SIG_BLOCK : SIG_UNBLOCK , &async_signal_set, NULL);
}
/**********************************************************************
* SIGNAL_Init
@ -184,18 +152,10 @@ BOOL SIGNAL_Init(void)
}
#endif /* HAVE_SIGALTSTACK */
sigemptyset(&async_signal_set);
SIGNAL_SetHandler( SIGCHLD, (void (*)())SIGNAL_child, 1);
#ifdef SIGIO
sigaddset(&async_signal_set, SIGIO);
/* SIGNAL_SetHandler( SIGIO, (void (*)())WINSOCK_sigio, 0); */
SIGNAL_SetHandler( SIGIO, (void (*)())ASYNC_sigio, 0);
#endif
sigaddset(&async_signal_set, SIGALRM);
/* ignore SIGPIPE so that WINSOCK can get a EPIPE error instead */
signal (SIGPIPE, SIG_IGN);
/* automatic child reaping to avoid zombies */
signal (SIGCHLD, SIG_IGN);
EXC_InitHandlers();
return TRUE;
}