tidying
[exim.git] / src / src / buildconfig.c
index 804c48c6729eabb4894c7e15825e2b2313c11d57..426714f9113dee0ea6e1c57d71aab8d39972b0a2 100644 (file)
@@ -36,6 +36,8 @@ normally called independently. */
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
+#include <sys/time.h>
+#include <poll.h>
 #include <pwd.h>
 #include <grp.h>
 
@@ -733,6 +735,7 @@ else if (isgroup)
       fprintf(new, "#define FIXED_NEVER_USERS     %d", j);
       for (i = 0; i < j; i++) fprintf(new, ", %d", (unsigned int)vector[i]);
       fprintf(new, "\n");
+      free(vector);
       }
     continue;
     }
@@ -950,9 +953,25 @@ else if (isgroup)
 defined. */
 
 if (have_auth)
-  {
   if (!support_crypteq) fprintf(new, "/* Force SUPPORT_CRYPTEQ for AUTH */\n"
     "#define SUPPORT_CRYPTEQ\n");
+
+/* Check poll() for timer functionality.
+Some OS' have released with it broken. */
+
+  {
+  struct timeval before, after;
+  size_t us;
+
+  gettimeofday(&before, NULL);
+  (void) 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 */