--- configure.orig	2021-03-04 14:31:59.000000000 +1100
+++ configure	2021-03-04 14:48:59.000000000 +1100
@@ -6950,12 +6950,12 @@
 /* end confdefs.h.  */
 #include <stdio.h>
 #include <sys/types.h>
-main()
+int main()
 {
   FILE *f=fopen("conftestval", "w");
-  if (!f) exit(1);
+  if (!f) return (1);
   fprintf(f, "%d\n", sizeof(off_t));
-  exit(0);
+  return (0);
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -7011,12 +7011,12 @@
 /* end confdefs.h.  */
 #include <stdio.h>
 #include <time.h>
-main()
+int main()
 {
   FILE *f=fopen("conftestval", "w");
-  if (!f) exit(1);
+  if (!f) return (1);
   fprintf(f, "%d\n", sizeof(time_t));
-  exit(0);
+  return (0);
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -7083,12 +7083,12 @@
 /* end confdefs.h.  */
 #include <stdio.h>
 #include <pthread.h>
-  main()
+int main()
   {
     FILE *f=fopen("conftestval", "w");
-    if (!f) exit(1);
+    if (!f) return (1);
     fprintf(f, "%d\n", sizeof(pthread_t));
-    exit(0);
+    return (0);
   }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -8565,13 +8565,13 @@
       void *foo(void *parm) {
         return NULL;
       }
-      main() {
+      int main() {
         pthread_attr_t attr;
         pthread_t id;
-        if (pthread_attr_init(&attr)) exit(-1);
-        if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) exit(-1);
-        if (pthread_create(&id, &attr, foo, NULL)) exit(-1);
-        exit(0);
+        if (pthread_attr_init(&attr)) return (-1);
+        if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) return (-1);
+        if (pthread_create(&id, &attr, foo, NULL)) return (-1);
+        return (0);
       }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -10209,7 +10209,7 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 
-main()
+int main()
 {
   int passive, gaierr, inet4 = 0, inet6 = 0;
   struct addrinfo hints, *ai, *aitop;
@@ -10281,12 +10281,12 @@
 
   if (aitop)
     freeaddrinfo(aitop);
-  exit(0);
+  return (0);
 
  bad:
   if (aitop)
     freeaddrinfo(aitop);
-  exit(1);
+  return (1);
 }
 
 _ACEOF
@@ -11547,7 +11547,7 @@
   int main()
   {
 	/* Success: exit code 0 */
-        exit((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1);
+        return ((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1);
   }
 
 _ACEOF
@@ -11883,7 +11883,7 @@
 
 int main()
 {
-	exit(((-1)>>3 == -1) ? 0 : 1);
+	return (((-1)>>3 == -1) ? 0 : 1);
 }
 
 _ACEOF
@@ -12265,12 +12265,16 @@
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
 int main()
 {
 	int val1 = nice(1);
 	if (val1 != -1 && val1 == nice(2))
-		exit(0);
-	exit(1);
+		return (0);
+	return (1);
 }
 
 _ACEOF
@@ -12303,6 +12307,9 @@
 /* end confdefs.h.  */
 
 #include <poll.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 
 int main (void)
     {
@@ -12314,15 +12321,15 @@
 
     if (poll_test < 0)
         {
-        exit(0);
+        return (0);
         }
     else if (poll_test == 0 && poll_struct.revents != POLLNVAL)
         {
-        exit(0);
+        return (0);
         }
     else
         {
-        exit(1);
+        return (1);
         }
     }
 
