From 99531e73e95bf6de4aed9bf64ac3f306e6dfb490 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Fri, 13 Jan 2023 13:29:07 +0100
Subject: [PATCH] configure.ac: Improve C99 compatibility of IPC_RMID check

Do not call the undeclared exit function.  Implicit function
declarations are likely not going to be supported by future compilers
by default, changing the outcome of this configure probe with
such compilers.
---
 configure.ac | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 03047899841..b8718955471 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1254,17 +1254,17 @@ elif test "x$shmtype" = "xsysv"; then
 	  char *shmaddr;
 	id = shmget (IPC_PRIVATE, 4, IPC_CREAT | 0600);
 	if (id == -1)
-	  exit (2);
+	  return 2;
 	  shmaddr = shmat (id, 0, 0);
 	  shmctl (id, IPC_RMID, 0);
 	  if ((char*) shmat (id, 0, 0) == (char*) -1)
 	  {
 	    shmdt (shmaddr);
-	    exit (1);
+	    return 1;
 	  }
 	  shmdt (shmaddr);
 	  shmdt (shmaddr);
-	  exit (0);
+	  return 0;
 	}
       ]])],
       [AC_DEFINE([IPC_RMID_DEFERRED_RELEASE],[1],
diff --git a/configure b/configure
index 6e62da8e3c164f82..f1c447baf7ff68f7 100755
--- a/configure
+++ b/configure
@@ -28898,17 +28898,17 @@ else $as_nop
 	  char *shmaddr;
 	id = shmget (IPC_PRIVATE, 4, IPC_CREAT | 0600);
 	if (id == -1)
-	  exit (2);
+	  return 2;
 	  shmaddr = shmat (id, 0, 0);
 	  shmctl (id, IPC_RMID, 0);
 	  if ((char*) shmat (id, 0, 0) == (char*) -1)
 	  {
 	    shmdt (shmaddr);
-	    exit (1);
+	    return 1;
 	  }
 	  shmdt (shmaddr);
 	  shmdt (shmaddr);
-	  exit (0);
+	  return 0;
 	}
 
 _ACEOF
