~ubuntu-branches/ubuntu/gutsy/ntp/gutsy

« back to all changes in this revision

Viewing changes to ntpd/ntp_timer.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-05-18 22:41:56 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070518224156-563ruqxsxvqvoy8h
Tags: 1:4.2.4p0+dfsg-1ubuntu1
* Merge from Debian unstable.
* Remaining Ubuntu changes:
  - Update version in conflicts/replaces to that which was shipped in edgy,
    which was later than that in Debian (due to the ubuntuX).
  - Change default server to ntp.ubuntu.com.
  - Remove stop links from rc0 and rc6
  - Call dh_installinit with --error-handler
  - Set Ubuntu maintainer address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 * procedure to do cleanup and print a message.
35
35
 */
36
36
 
 
37
volatile int interface_interval = 300;     /* update interface every 5 minutes as default */
 
38
          
37
39
/*
38
40
 * Alarm flag.  The mainline code imports this.
39
41
 */
46
48
static  u_long keys_timer;              /* minute timer */
47
49
static  u_long stats_timer;             /* stats timer */
48
50
static  u_long huffpuff_timer;          /* huff-n'-puff timer */
 
51
static  u_long interface_timer;         /* interface update timer */
49
52
#ifdef OPENSSL
50
53
static  u_long revoke_timer;            /* keys revoke timer */
51
54
u_char  sys_revoke = KEY_REVOKE;        /* keys revoke timeout (log2 s) */
138
141
init_timer(void)
139
142
{
140
143
# if defined SYS_WINNT & !defined(SYS_CYGWIN32)
141
 
        HANDLE hToken;
 
144
        HANDLE hToken = INVALID_HANDLE_VALUE;
142
145
        TOKEN_PRIVILEGES tkp;
143
146
# endif /* SYS_WINNT */
144
147
 
150
153
        adjust_timer = 1;
151
154
        stats_timer = 0;
152
155
        huffpuff_timer = 0;
 
156
        interface_timer = 0;
153
157
        current_time = 0;
154
158
        timer_overflows = 0;
155
159
        timer_xmtcalls = 0;
336
340
#endif /* OPENSSL */
337
341
 
338
342
        /*
 
343
         * interface update timer
 
344
         */
 
345
        if (interface_interval && interface_timer <= current_time) {
 
346
                timer_interfacetimeout(current_time + interface_interval);
 
347
#ifdef DEBUG
 
348
          if (debug)
 
349
            printf("timer: interface update\n");
 
350
#endif
 
351
          interface_update(NULL, NULL);
 
352
        }
 
353
        
 
354
        /*
339
355
         * Finally, periodically write stats.
340
356
         */
341
357
        if (stats_timer <= current_time) {
373
389
}
374
390
#endif /* SYS_WINNT */
375
391
 
 
392
void
 
393
timer_interfacetimeout(u_long timeout)
 
394
{
 
395
        interface_timer = timeout;
 
396
}
 
397
 
376
398
 
377
399
/*
378
400
 * timer_clr_stats - clear timer module stat counters