clock.c (98121) | clock.c (98841) |
---|---|
1/* 2 * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers. 3 * All rights reserved. 4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. 5 * Copyright (c) 1988, 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * By using this file, you agree to the terms and conditions set 9 * forth in the LICENSE file which can be found at the top level of 10 * the sendmail distribution. 11 * 12 */ 13 14#include <sm/gen.h> | 1/* 2 * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers. 3 * All rights reserved. 4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. 5 * Copyright (c) 1988, 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * By using this file, you agree to the terms and conditions set 9 * forth in the LICENSE file which can be found at the top level of 10 * the sendmail distribution. 11 * 12 */ 13 14#include <sm/gen.h> |
15SM_RCSID("@(#)$Id: clock.c,v 1.35 2002/03/22 18:34:38 gshapiro Exp $") | 15SM_RCSID("@(#)$Id: clock.c,v 1.35.2.1 2002/06/20 05:14:45 gshapiro Exp $") |
16#include <unistd.h> 17#include <time.h> 18#include <errno.h> 19#if SM_CONF_SETITIMER 20# include <sys/time.h> 21#endif /* SM_CONF_SETITIMER */ 22#include <sm/heap.h> 23#include <sm/debug.h> --- 228 unchanged lines hidden (view full) --- 252sm_clear_events() 253{ 254 register SM_EVENT *ev; 255#if SM_CONF_SETITIMER 256 struct itimerval clr; 257#endif /* SM_CONF_SETITIMER */ 258 int wasblocked; 259 | 16#include <unistd.h> 17#include <time.h> 18#include <errno.h> 19#if SM_CONF_SETITIMER 20# include <sys/time.h> 21#endif /* SM_CONF_SETITIMER */ 22#include <sm/heap.h> 23#include <sm/debug.h> --- 228 unchanged lines hidden (view full) --- 252sm_clear_events() 253{ 254 register SM_EVENT *ev; 255#if SM_CONF_SETITIMER 256 struct itimerval clr; 257#endif /* SM_CONF_SETITIMER */ 258 int wasblocked; 259 |
260 if (SmEventQueue == NULL) 261 return; 262 | |
263 /* nothing will be left in event queue, no need for an alarm */ 264#if SM_CONF_SETITIMER 265 clr.it_interval.tv_sec = 0; 266 clr.it_interval.tv_usec = 0; 267 clr.it_value.tv_sec = 0; 268 clr.it_value.tv_usec = 0; 269 (void) setitimer(ITIMER_REAL, &clr, NULL); 270#else /* SM_CONF_SETITIMER */ 271 (void) alarm(0); 272#endif /* SM_CONF_SETITIMER */ | 260 /* nothing will be left in event queue, no need for an alarm */ 261#if SM_CONF_SETITIMER 262 clr.it_interval.tv_sec = 0; 263 clr.it_interval.tv_usec = 0; 264 clr.it_value.tv_sec = 0; 265 clr.it_value.tv_usec = 0; 266 (void) setitimer(ITIMER_REAL, &clr, NULL); 267#else /* SM_CONF_SETITIMER */ 268 (void) alarm(0); 269#endif /* SM_CONF_SETITIMER */ |
270 271 if (SmEventQueue == NULL) 272 return; 273 |
|
273 wasblocked = sm_blocksignal(SIGALRM); 274 275 /* find the end of the EventQueue */ 276 for (ev = SmEventQueue; ev->ev_link != NULL; ev = ev->ev_link) 277 continue; 278 279 ENTER_CRITICAL(); 280 ev->ev_link = SmFreeEventList; --- 247 unchanged lines hidden --- | 274 wasblocked = sm_blocksignal(SIGALRM); 275 276 /* find the end of the EventQueue */ 277 for (ev = SmEventQueue; ev->ev_link != NULL; ev = ev->ev_link) 278 continue; 279 280 ENTER_CRITICAL(); 281 ev->ev_link = SmFreeEventList; --- 247 unchanged lines hidden --- |