X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/50b1039fa7de644b62a1ebe38929bf16ec8e3b93..534c20b22f89ffbe99a4d6a1035b74eacc544ee5:/src/atimer.c diff --git a/src/atimer.c b/src/atimer.c index eafe0f5ebf..492aa4ec04 100644 --- a/src/atimer.c +++ b/src/atimer.c @@ -35,11 +35,6 @@ Boston, MA 02111-1307, USA. */ #include #endif -/* The ubiquitous min/max macros. */ - -#define max(X, Y) ((X) > (Y) ? (X) : (Y)) -#define min(X, Y) ((X) < (Y) ? (X) : (Y)) - /* Free-list of atimer structures. */ static struct atimer *free_atimers; @@ -62,7 +57,7 @@ static struct atimer *atimers; int pending_atimers; -/* Block/unblock SIGALRM.. */ +/* Block/unblock SIGALRM. */ #define BLOCK_ATIMERS sigblock (sigmask (SIGALRM)) #define UNBLOCK_ATIMERS sigunblock (sigmask (SIGALRM)) @@ -73,6 +68,7 @@ static void set_alarm P_ ((void)); static void schedule_atimer P_ ((struct atimer *)); static struct atimer *append_atimer_lists P_ ((struct atimer *, struct atimer *)); +SIGTYPE alarm_signal_handler (); /* Start a new atimer of type TYPE. TIME specifies when the timer is @@ -176,7 +172,7 @@ cancel_atimer (timer) struct atimer **list = i ? &stopped_atimers : &atimers; /* See if TIMER is active or stopped. */ - for (t = *list, prev = 0; t && t != timer; t = t->next) + for (t = *list, prev = NULL; t && t != timer; prev = t, t = t->next) ; /* If it is, take it off the its list, and put in on the @@ -191,6 +187,7 @@ cancel_atimer (timer) t->next = free_atimers; free_atimers = t; + break; } } @@ -394,12 +391,6 @@ alarm_signal_handler (signo) EMACS_GET_TIME (now); } -#if defined (USG) && !defined (POSIX_SIGNALS) - /* USG systems forget handlers when they are used; - must reestablish each time. */ - signal (SIGALRM, alarm_signal_handler); -#endif /* USG */ - set_alarm (); }