1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-14 15:36:34 +00:00

Cleanup timer leftovers (#341)

* Remove unnecessary variables and calls during itimer setup.

* Variable referenced from signal handler should be volatile and sig_atomic_t
This commit is contained in:
Nick Briggs 2021-02-10 13:58:40 -08:00 committed by GitHub
parent 3ae9d558b1
commit c9a0d441c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 8 deletions

View File

@ -135,7 +135,7 @@ static struct timeval SelectTimeout = {0, 0};
#endif /* DOS */
#ifdef XWINDOW
extern int Event_Req;
extern volatile sig_atomic_t Event_Req;
#endif /* XWINDOW */
extern MISCSTATS *MiscStats;

View File

@ -90,7 +90,7 @@ int TIMEOUT_TIME; /* For file system timeout */
#ifdef XWINDOW
#define FALSE 0
#define TRUE !FALSE
int Event_Req = FALSE;
volatile sig_atomic_t Event_Req = FALSE;
#endif /* XWINDOW */
static int gettime(int casep);
@ -463,7 +463,7 @@ static void int_timer_init()
_dos_setvect(0x1c, DOStimer); /* hook our int handler to timer int */
#else
struct itimerval timert, tmpt;
struct itimerval timert;
struct sigaction timer_action;
timer_action.sa_handler = int_timer_service;
@ -477,11 +477,7 @@ static void int_timer_init()
/* then attach a timer to it and turn it loose */
timert.it_interval.tv_sec = timert.it_value.tv_sec = 0;
timert.it_interval.tv_usec = timert.it_value.tv_usec = TIMER_INTERVAL;
timerclear(&tmpt.it_value);
timerclear(&tmpt.it_interval);
setitimer(ITIMER_VIRTUAL, &timert, &tmpt);
getitimer(ITIMER_VIRTUAL, &tmpt);
setitimer(ITIMER_VIRTUAL, &timert, NULL);
DBPRINT(("Timer interval set to %d usec\n", timert.it_value.tv_usec));
#endif /* DOS */