diff options
author | Owen Taylor <otaylor@redhat.com> | 2004-03-01 20:56:47 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2004-03-01 20:56:47 +0000 |
commit | 44ef9006758b4bfd899b4ba9b46b69528ed070f5 (patch) | |
tree | 68a5207c5b0d396f2c9d281646ffc0c6a6aae3d0 | |
parent | fed19fc424e38c2575f51e82218e35568a512631 (diff) |
Don't call waitpid() on a source that has already exited.
Mon Mar 1 15:49:09 2004 Owen Taylor <otaylor@redhat.com>
* glib/gmain.c (check_for_child_exited): Don't
call waitpid() on a source that has already exited.
* glib/gmain.c (g_child_watch_check): Return TRUE
only if the child actually exited.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 8 | ||||
-rw-r--r-- | ChangeLog.pre-2-12 | 8 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 8 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 8 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 8 | ||||
-rw-r--r-- | glib/gmain.c | 13 |
7 files changed, 56 insertions, 5 deletions
@@ -1,3 +1,11 @@ +Mon Mar 1 15:49:09 2004 Owen Taylor <otaylor@redhat.com> + + * glib/gmain.c (check_for_child_exited): Don't + call waitpid() on a source that has already exited. + + * glib/gmain.c (g_child_watch_check): Return TRUE + only if the child actually exited. + Mon Mar 1 15:39:57 2004 Owen Taylor <otaylor@redhat.com> Patch from J. Ali Harlow diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 75bca55c0..ee9c2d048 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +Mon Mar 1 15:49:09 2004 Owen Taylor <otaylor@redhat.com> + + * glib/gmain.c (check_for_child_exited): Don't + call waitpid() on a source that has already exited. + + * glib/gmain.c (g_child_watch_check): Return TRUE + only if the child actually exited. + Mon Mar 1 15:39:57 2004 Owen Taylor <otaylor@redhat.com> Patch from J. Ali Harlow diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 75bca55c0..ee9c2d048 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,11 @@ +Mon Mar 1 15:49:09 2004 Owen Taylor <otaylor@redhat.com> + + * glib/gmain.c (check_for_child_exited): Don't + call waitpid() on a source that has already exited. + + * glib/gmain.c (g_child_watch_check): Return TRUE + only if the child actually exited. + Mon Mar 1 15:39:57 2004 Owen Taylor <otaylor@redhat.com> Patch from J. Ali Harlow diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 75bca55c0..ee9c2d048 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +Mon Mar 1 15:49:09 2004 Owen Taylor <otaylor@redhat.com> + + * glib/gmain.c (check_for_child_exited): Don't + call waitpid() on a source that has already exited. + + * glib/gmain.c (g_child_watch_check): Return TRUE + only if the child actually exited. + Mon Mar 1 15:39:57 2004 Owen Taylor <otaylor@redhat.com> Patch from J. Ali Harlow diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 75bca55c0..ee9c2d048 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +Mon Mar 1 15:49:09 2004 Owen Taylor <otaylor@redhat.com> + + * glib/gmain.c (check_for_child_exited): Don't + call waitpid() on a source that has already exited. + + * glib/gmain.c (g_child_watch_check): Return TRUE + only if the child actually exited. + Mon Mar 1 15:39:57 2004 Owen Taylor <otaylor@redhat.com> Patch from J. Ali Harlow diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 75bca55c0..ee9c2d048 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +Mon Mar 1 15:49:09 2004 Owen Taylor <otaylor@redhat.com> + + * glib/gmain.c (check_for_child_exited): Don't + call waitpid() on a source that has already exited. + + * glib/gmain.c (g_child_watch_check): Return TRUE + only if the child actually exited. + Mon Mar 1 15:39:57 2004 Owen Taylor <otaylor@redhat.com> Patch from J. Ali Harlow diff --git a/glib/gmain.c b/glib/gmain.c index b78842eb4..bed8e6288 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -3441,7 +3441,7 @@ g_child_watch_check (GSource *source) #else /* G_OS_WIN32 */ -static void +static gboolean check_for_child_exited (GSource *source) { GChildWatchSource *child_watch_source; @@ -3452,6 +3452,9 @@ check_for_child_exited (GSource *source) child_watch_source = (GChildWatchSource *) source; + if (child_watch_source->child_exited) + return TRUE; + if (child_watch_source->count < count) { gint child_status; @@ -3463,6 +3466,8 @@ check_for_child_exited (GSource *source) } child_watch_source->count = count; } + + return child_watch_source->child_exited; } static gboolean @@ -3474,9 +3479,7 @@ g_child_watch_prepare (GSource *source, child_watch_source = (GChildWatchSource *) source; - check_for_child_exited (source); - - return child_watch_source->child_exited; + return check_for_child_exited (source); } @@ -3487,7 +3490,7 @@ g_child_watch_check (GSource *source) child_watch_source = (GChildWatchSource *) source; - return (child_watch_source->count < child_watch_count); + return check_for_child_exited (source); } #endif /* G_OS_WIN32 */ |