diff options
| author | Scott Moynes <smoynes@nexus.carleton.ca> | 2003-05-16 19:12:06 +0000 |
|---|---|---|
| committer | Scott Moynes <smoynes@nexus.carleton.ca> | 2003-05-16 19:12:06 +0000 |
| commit | 66d3006671e7729b3f6244c49fda175caaae5174 (patch) | |
| tree | cb96baedf34a0e13e9fd9903018cb00f19aa77de /plugins/menu | |
| parent | 2d6c9a7ba683271aeda92df524a38a52236a0228 (diff) | |
Fixed child wait.
Diffstat (limited to 'plugins/menu')
| -rw-r--r-- | plugins/menu/timed_menu.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/menu/timed_menu.c b/plugins/menu/timed_menu.c index ee1de793..df2acbb2 100644 --- a/plugins/menu/timed_menu.c +++ b/plugins/menu/timed_menu.c @@ -31,6 +31,7 @@ typedef struct { char *buf; unsigned long buflen; int fd; + pid_t pid; } Timed_Menu_Data; @@ -54,7 +55,10 @@ void timed_menu_clean_up(Menu *m) { TIMED_MENU_DATA(m)->fd = -1; } - /* child is reaped by glib ? */ + if (TIMED_MENU_DATA(m)->pid != -1) { + waitpid(TIMED_MENU_DATA(m)->pid, NULL, 0); + TIMED_MENU_DATA(m)->pid = -1; + } } void timed_menu_read_pipe(int fd, Menu *menu) @@ -134,7 +138,7 @@ void timed_menu_timeout_handler(Menu *data) NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, - NULL, + &TIMED_MENU_DATA(data)->pid, NULL, NULL, &child_stdout, @@ -168,6 +172,7 @@ void *plugin_create() d->buf = NULL; d->buflen = 0; d->fd = -1; + d->pid = -1; m->plugin_data = (void *)d; |
