Make drivers install signal handlers so they don't die at exit.

This commit is contained in:
Ben Gras 2006-01-17 17:43:35 +00:00
parent 24f8db780c
commit 4102c1b44c
3 changed files with 14 additions and 1 deletions

View file

@ -297,7 +297,7 @@ PUBLIC int main()
sa.sa_handler = SIG_MESS;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
if (sigaction(SIGTERM,&sa,NULL)<0) panic("RS","sigaction failed", errno);
if (sigaction(SIGTERM,&sa,NULL)<0) panic("AT","sigaction failed", errno);
/* Set special disk parameters then call the generic main loop. */
init_params();

View file

@ -97,6 +97,12 @@ PRIVATE struct driver w_dtab = {
PUBLIC int main()
{
long v;
struct sigaction sa;
sa.sa_handler = SIG_MESS;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
if (sigaction(SIGTERM,&sa,NULL)<0) panic("BIOS","sigaction failed", errno);
v= 0;
env_parse("bios_remap_first", "d", 0, &v, 0, 1);

View file

@ -75,6 +75,13 @@ PRIVATE char dev_zero[ZERO_BUF_SIZE];
PUBLIC int main(void)
{
/* Main program. Initialize the memory driver and start the main loop. */
struct sigaction sa;
sa.sa_handler = SIG_MESS;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
if (sigaction(SIGTERM,&sa,NULL)<0) panic("MEM","sigaction failed", errno);
m_init();
driver_task(&m_dtab);
return(OK);