#define PAM_H_IN_PAM
#define SIOCGIFCONF_GIVES_ADDR
-/* OSX 10.2 does not have poll.h, 10.3 does emulate it badly. */
-#define NO_POLL_H
#define F_FREESP O_TRUNC
typedef struct flock flock_t;
Consider reducing MAX_LOCALHOST_NUMBER */
#ifndef _BSD_SOCKLEN_T_
-#define _BSD_SOCKLEN_T_ int32_t /* socklen_t (duh) */
+# define _BSD_SOCKLEN_T_ int32_t /* socklen_t (duh) */
#endif
/* Settings for handling IP options. There's no netinet/ip_var.h. The IP
else
{
- if (smtp_out != NULL && !f.disable_delay_flush)
+ if (smtp_out && !f.disable_delay_flush)
mac_smtp_fflush();
#if !defined(NO_POLL_H) && defined (POLLRDHUP)
HDEBUG(D_acl) debug_printf_indent("delay cancelled by peer close\n");
}
#else
- /* It appears to be impossible to detect that a TCP/IP connection has
- gone away without reading from it. This means that we cannot shorten
- the delay below if the client goes away, because we cannot discover
- that the client has closed its end of the connection. (The connection
- is actually in a half-closed state, waiting for the server to close its
- end.) It would be nice to be able to detect this state, so that the
- Exim process is not held up unnecessarily. However, it seems that we
- can't. The poll() function does not do the right thing, and in any case
- it is not always available.
- */
+ /* Lacking POLLRDHUP it appears to be impossible to detect that a
+ TCP/IP connection has gone away without reading from it. This means
+ that we cannot shorten the delay below if the client goes away,
+ because we cannot discover that the client has closed its end of the
+ connection. (The connection is actually in a half-closed state,
+ waiting for the server to close its end.) It would be nice to be able
+ to detect this state, so that the Exim process is not held up
+ unnecessarily. However, it seems that we can't. The poll() function
+ does not do the right thing, and in any case it is not always
+ available. */
while (delay > 0) delay = sleep(delay);
#endif
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
+#include <sys/time.h>
+#include <poll.h>
#include <pwd.h>
#include <grp.h>
"#define SUPPORT_CRYPTEQ\n");
}
+/* Check poll() for timer functionality.
+Some OS' have released with it broken. */
+
+ {
+ struct timeval before, after;
+ int rc;
+ size_t us;
+
+ gettimeofday(&before, NULL);
+ rc = poll(NULL, 0, 500);
+ gettimeofday(&after, NULL);
+
+ us = (after.tv_sec - before.tv_sec) * 1000000 +
+ (after.tv_usec - before.tv_usec);
+
+ if (us < 400000)
+ fprintf(new, "#define NO_POLL_H\n");
+ }
+
/* End off */
fprintf(new, "\n/* End of config.h */\n");