[evolution-patches] More waitpid/EINTR guarding




-JP
-- 
JP Rosevear <jpr ximian com>
Ximian, Inc.
? fd-leak.patch
? soup-waitpid.patch
? soup-waitpid2.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/soup/ChangeLog,v
retrieving revision 1.229.2.40.2.61
diff -u -r1.229.2.40.2.61 ChangeLog
--- ChangeLog	1 Apr 2003 19:19:29 -0000	1.229.2.40.2.61
+++ ChangeLog	2 Apr 2003 19:50:40 -0000
@@ -1,3 +1,7 @@
+2003-04-02  JP Rosevear  <jpr ximian com>
+
+	* src/libsoup/soup-socket-unix.c: guard waitpid calls for EINTR
+
 2003-04-01  JP Rosevear  <jpr ximian com>
 
 	* src/libsoup/soup-ssl.c (soup_ssl_hup_waitpid): make sure we
Index: src/libsoup/soup-socket-unix.c
===================================================================
RCS file: /cvs/gnome/soup/src/libsoup/soup-socket-unix.c,v
retrieving revision 1.12.2.6.2.2
diff -u -r1.12.2.6.2.2 soup-socket-unix.c
--- src/libsoup/soup-socket-unix.c	28 Oct 2002 21:04:15 -0000	1.12.2.6.2.2
+++ src/libsoup/soup-socket-unix.c	2 Apr 2003 19:50:40 -0000
@@ -440,7 +440,7 @@
 
 		g_source_remove (state->watch);
 		close (state->fd);
-		waitpid (state->pid, &ret, 0);
+		while (waitpid (state->pid, &ret, 0) == -1 && errno == EINTR);
 
 		if (WIFSIGNALED (ret) || WEXITSTATUS (ret) != 1) 
 			goto ERROR;
@@ -481,7 +481,7 @@
 		close (state->fd);
 
 		/* FIXME: Wait for HUP signal before doing this */
-		waitpid (state->pid, NULL, 0);
+		while (waitpid (state->pid, NULL, 0) == -1 && errno == EINTR);
 	}
 
 	/* Get state data before realloc */
@@ -785,7 +785,7 @@
 		 * Wait for the SIGSTOP from PTRACE_ATTACH to arrive at the
 		 * parent.  
 		 */
-		waitpid (getppid (), NULL, WUNTRACED);
+		while (waitpid (getppid (), NULL, WUNTRACED) == -1 && errno == EINTR);		
 
 		if (ptrace (SOUP_PTRACE_DETACH, getppid (), NULL, NULL) == -1)
 			g_warning ("ptrace: Detach failed: %s", 
@@ -881,7 +881,7 @@
 
 		close (state->fd);
 		kill (state->pid, SIGKILL);
-		waitpid (state->pid, NULL, 0);
+		while (waitpid (state->pid, NULL, 0) == -1 && errno == EINTR);
 
 		g_free (state);
 	}
@@ -1024,7 +1024,7 @@
 					state->data);
 
 			close (state->fd);
-			waitpid (state->pid, NULL, 0);
+			while (waitpid (state->pid, NULL, 0) == -1 && errno == EINTR);
 			g_free (state);
 			return FALSE;
 		}
@@ -1203,7 +1203,7 @@
 
 	close (state->fd);
 	kill (state->pid, SIGKILL);
-	waitpid (state->pid, NULL, 0);
+	while (waitpid (state->pid, NULL, 0) == -1 && errno == EINTR);
 
 	g_free(state);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]