diff src/auth/mech-winbind.c @ 6230:5cf1c1ae7dd8 HEAD

waitpid() fix
author Timo Sirainen <tss@iki.fi>
date Tue, 07 Aug 2007 15:09:26 +0300
parents 0b4ec1687f3c
children 616872f3710c
line wrap: on
line diff
--- a/src/auth/mech-winbind.c	Tue Aug 07 14:54:55 2007 +0300
+++ b/src/auth/mech-winbind.c	Tue Aug 07 15:09:26 2007 +0300
@@ -62,13 +62,13 @@
 
 static void winbind_wait_pid(struct winbind_helper *winbind)
 {
-	int status;
+	int status, ret;
 
 	if (winbind->pid == -1)
 		return;
 
-	if (waitpid(winbind->pid, &status, WNOHANG) == -1) {
-		if (errno != ECHILD && errno != EINTR)
+	if ((ret = waitpid(winbind->pid, &status, WNOHANG)) <= 0) {
+		if (ret < 0 && errno != ECHILD && errno != EINTR)
 			i_error("waitpid() failed: %m");
 		return;
 	}