Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1122 → Rev 1123

/demos/trunk/thdemo/demo.c
137,29 → 137,9
}
 
 
void demo_exc_handler(int signo, siginfo_t *info, void *extra)
{
struct timespec t;
 
grx_close();
 
/* Default action for an kern exception is */
kern_cli();
ll_gettime(TIME_EXACT, &t),
kern_printf("\nHartik Exception raised!!!"
"\nTime (s:ns) :%ld:%ld"
"\nException number:%d"
"\nPID :%d\n",
t.tv_sec, t.tv_nsec, info->si_value.sival_int,
info->si_task);
sys_end();
// ll_abort(5);
}
 
void my_close(void *arg)
{
grx_close();
// sys_status(3);
}
 
 
199,8 → 179,6
 
KEY_EVT k;
 
struct sigaction action;
 
srand(4);
 
version();
234,18 → 212,6
k.ascii = 13;
keyb_hook(k,endfun);
 
/* Init the standard Hartik exception handler */
/* Set the signal action */
action.sa_flags = SA_SIGINFO;
action.sa_sigaction = demo_exc_handler;
action.sa_handler = 0;
sigfillset(&action.sa_mask); /* we block all the other signals... */
 
if (sigaction(SIGHEXC, &action, NULL) == -1) {
perror("Error initializing signals...");
sys_end();
}
 
sys_atrunlevel(my_close, NULL, RUNLEVEL_BEFORE_EXIT);