Deleted Added
full compact
listener.c (98121) listener.c (102528)
1/*
2 * Copyright (c) 1999-2002 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 *
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
8 *
9 */
10
11#include <sm/gen.h>
1/*
2 * Copyright (c) 1999-2002 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 *
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
8 *
9 */
10
11#include <sm/gen.h>
12SM_RCSID("@(#)$Id: listener.c,v 8.85 2002/05/28 18:17:41 gshapiro Exp $")
12SM_RCSID("@(#)$Id: listener.c,v 8.85.2.1 2002/08/09 22:13:36 gshapiro Exp $")
13
14/*
15** listener.c -- threaded network listener
16*/
17
18#include "libmilter.h"
19#include <sm/errstring.h>
20

--- 595 unchanged lines hidden (view full) ---

616# define MI_SLEEP(s) \
617{ \
618 int rs = 0; \
619 struct timeval st; \
620 \
621 st.tv_sec = (s); \
622 st.tv_usec = 0; \
623 if (st.tv_sec > 0) \
13
14/*
15** listener.c -- threaded network listener
16*/
17
18#include "libmilter.h"
19#include <sm/errstring.h>
20

--- 595 unchanged lines hidden (view full) ---

616# define MI_SLEEP(s) \
617{ \
618 int rs = 0; \
619 struct timeval st; \
620 \
621 st.tv_sec = (s); \
622 st.tv_usec = 0; \
623 if (st.tv_sec > 0) \
624 rs = select(0, NULL, NULL, NULL, &st); \
625 if (rs != 0) \
626 { \
624 { \
627 smi_log(SMI_LOG_ERR, \
628 "MI_SLEEP(): select() returned non-zero result %d, errno = %d", \
629 rs, errno); \
625 for (;;) \
626 { \
627 rs = select(0, NULL, NULL, NULL, &st); \
628 if (rs < 0 && errno == EINTR) \
629 continue; \
630 if (rs != 0) \
631 { \
632 smi_log(SMI_LOG_ERR, \
633 "MI_SLEEP(): select() returned non-zero result %d, errno = %d", \
634 rs, errno); \
635 } \
636 } \
630 } \
631}
632#else /* BROKEN_PTHREAD_SLEEP */
633# define MI_SLEEP(s) sleep((s))
634#endif /* BROKEN_PTHREAD_SLEEP */
635
636int
637mi_listener(conn, dbg, smfi, timeout, backlog)

--- 209 unchanged lines hidden ---
637 } \
638}
639#else /* BROKEN_PTHREAD_SLEEP */
640# define MI_SLEEP(s) sleep((s))
641#endif /* BROKEN_PTHREAD_SLEEP */
642
643int
644mi_listener(conn, dbg, smfi, timeout, backlog)

--- 209 unchanged lines hidden ---