From: JP Rosevear Date: Thu, 3 Apr 2003 17:09:44 +0000 (+0000) Subject: guard against EINTR error during waitpid X-Git-Tag: LIBSOUP_1_99_17~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5886760d4c6b764c34f6c41d4566d68684b445de;p=platform%2Fupstream%2Flibsoup.git guard against EINTR error during waitpid 2003-04-03 JP Rosevear * libsoup/soup-ssl.c (soup_ssl_hup_waitpid): guard against EINTR error during waitpid * libsoup/soup-address.c: ditto --- diff --git a/ChangeLog b/ChangeLog index e3568c1..6a0a3c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-04-03 JP Rosevear + + * libsoup/soup-ssl.c (soup_ssl_hup_waitpid): guard against EINTR + error during waitpid + + * libsoup/soup-address.c: ditto + 2003-04-02 Joe Shaw * libsoup/soup-context.c (connection_death): Only drop the diff --git a/libsoup/soup-address.c b/libsoup/soup-address.c index 2a66d24..2fc164d 100644 --- a/libsoup/soup-address.c +++ b/libsoup/soup-address.c @@ -696,7 +696,8 @@ soup_address_new_cb (GIOChannel* iochannel, 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; @@ -736,7 +737,8 @@ soup_address_new_cb (GIOChannel* iochannel, 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) + ; } g_hash_table_remove (lookup_hash, state->name); @@ -968,7 +970,8 @@ soup_address_new (const gchar* name, SoupAddressNewFn func, gpointer data) * 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", @@ -1065,7 +1068,8 @@ soup_address_new_cancel (SoupAddressNewId id) g_source_remove (state->watch); close (state->fd); kill (state->pid, SIGKILL); - waitpid (state->pid, NULL, 0); + while (waitpid (state->pid, NULL, 0) == -1 && errno == EINTR) + ; g_free (state); } @@ -1208,7 +1212,8 @@ soup_address_get_name_cb (GIOChannel* iochannel, state->data); close (state->fd); - waitpid (state->pid, NULL, 0); + while (waitpid (state->pid, NULL, 0) == -1 && errno == EINTR) + ; g_free (state); return FALSE; } @@ -1364,7 +1369,8 @@ soup_address_get_name_cancel (SoupAddressGetNameId id) close (state->fd); kill (state->pid, SIGKILL); - waitpid (state->pid, NULL, 0); + while (waitpid (state->pid, NULL, 0) == -1 && errno == EINTR) + ; g_free(state); } diff --git a/libsoup/soup-ssl.c b/libsoup/soup-ssl.c index b60657f..1400e31 100644 --- a/libsoup/soup-ssl.c +++ b/libsoup/soup-ssl.c @@ -59,7 +59,8 @@ soup_ssl_hup_waitpid (GIOChannel *source, GIOCondition condition, gpointer user_ { SoupSSLInfo *ssl_info = user_data; - waitpid (ssl_info->ppid, NULL, 0); + while (waitpid (ssl_info->ppid, NULL, 0) == -1 && errno == EINTR) + ; g_io_channel_unref (ssl_info->real_sock); g_free (ssl_info);