summaryrefslogtreecommitdiffstats
path: root/web/attachments/144118-nagios-plugins-1.4.1-waitpid.patch
blob: 331da4b74697591d2c7fd1213b30d9783c821ae0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--- nagios-plugins-1.4.1/plugins/popen.c.orig	2005-08-02 13:44:47.631761141 +0200
+++ nagios-plugins-1.4.1/plugins/popen.c	2005-08-02 13:52:24.589616713 +0200
@@ -221,8 +221,13 @@
 		return (1);
 
 	while (waitpid (pid, &status, 0) < 0)
+	{
+		if (errno == ECHILD)
+			return (0);							/* Child has already exited */
+
 		if (errno != EINTR)
 			return (1);							/* error other than EINTR from waitpid() */
+	}
 
 	if (WIFEXITED (status))
 		return (WEXITSTATUS (status));	/* return child's termination status */