Avoid code duplication.
authorwtc%netscape.com
Wed, 28 Jun 2000 01:42:54 +0000
changeset 1444 aacfcb9998603a9b887b959f17bda476bf883d64
parent 1443 85c5c9f02a88ef4338751c61761eda5c772ab692
child 1445 8c536015c0f673105218f67a0e0d17d2ff88a21d
push idunknown
push userunknown
push dateunknown
Avoid code duplication.
pr/src/md/unix/unix.c
--- a/pr/src/md/unix/unix.c
+++ b/pr/src/md/unix/unix.c
@@ -2082,17 +2082,16 @@ static void HPUX9_ClockInterruptHandler(
 #endif /* HPUX9 */
 
 /* # of milliseconds per clock tick that we will use */
 #define MSEC_PER_TICK    50
 
 
 void _MD_StartInterrupts()
 {
-    struct itimerval itval;
     char *eval;
 #ifdef HPUX9
     struct sigvec vec;
 
     vec.sv_handler = (void (*)()) HPUX9_ClockInterruptHandler;
     vec.sv_mask = 0;
     vec.sv_flags = 0;
     sigvector(SIGALRM, &vec, 0);
@@ -2109,20 +2108,17 @@ void _MD_StartInterrupts()
         if (atoi(eval) == 0)
             _nspr_noclock = 0;
         else
             _nspr_noclock = 1;
     }
 
 #ifndef _PR_NO_CLOCK_TIMER
     if (!_nspr_noclock) {
-        itval.it_interval.tv_sec = 0;
-        itval.it_interval.tv_usec = MSEC_PER_TICK * PR_USEC_PER_MSEC;
-        itval.it_value = itval.it_interval;
-        setitimer(ITIMER_REAL, &itval, 0);
+        _MD_EnableClockInterrupts();
     }
 #endif
 }
 
 void _MD_StopInterrupts()
 {
     sigprocmask(SIG_BLOCK, &timer_set, 0);
 }