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.
This commit is contained in:
Owen Taylor
2004-03-01 20:56:47 +00:00
committed by Owen Taylor
parent fed19fc424
commit 44ef900675
7 changed files with 56 additions and 5 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 */