changeset 3235:d20aee22af6a HEAD

Make sure "whether fd passing works" check doesn't get stuck (HP-UX fix).
author Timo Sirainen <tss@iki.fi>
date Sun, 27 Mar 2005 17:11:02 +0300
parents 06f9da4ff7a5
children f6eb50f0d2c0
files configure.in
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/configure.in	Sun Mar 27 16:51:54 2005 +0300
+++ b/configure.in	Sun Mar 27 17:11:02 2005 +0300
@@ -802,7 +802,7 @@
     
     int main(void)
     {
-	    int fd[2], send_fd, recv_fd, status;
+	    int fd[2], send_fd, recv_fd;
 	    struct stat st, st2;
 	    char data;
     
@@ -816,10 +816,15 @@
 	    case -1:
 		    return 2;
 	    case 0:
+		    alarm(1);
 		    if (fd_send(fd[0], send_fd, &data, 1) != 1) return 2;
-		    wait(&status);
-		    return status;
+		    return 0;
 	    default:
+		    alarm(2);
+		    if (wait(&status) == -1)
+		      return 2;
+		    if (status != 0)
+		      return status;
 		    if (fd_read(fd[1], &data, 1, &recv_fd) != 1) return 1;
 		    if (fstat(recv_fd, &st2) < 0) return 2;
 		    return st.st_ino == st2.st_ino ? 0 : 1;