Don't leave zombie processes if dmenu call fails
If dmenu didn't return anything we returned out of the function without calling `waitpid` to collect the childs exit code, leaving to the child process to be left as a zombie indefinitely. This commit makes `waitpid` be called before the return checks are done.
This commit is contained in:
parent
b034d31f80
commit
c23af0e021
@ -7,7 +7,7 @@
|
|||||||
- Support for raw icons
|
- Support for raw icons
|
||||||
- `hide_duplicate_count` option to hide the number of duplicate notifications
|
- `hide_duplicate_count` option to hide the number of duplicate notifications
|
||||||
- Support for per-urgency frame colours
|
- Support for per-urgency frame colours
|
||||||
- `markup` setting for more fine-gained control over how markup is handled
|
- `markup` setting for more fine-grained control over how markup is handled
|
||||||
- `history_ignore` rule action to exclude a notification from being added to the history
|
- `history_ignore` rule action to exclude a notification from being added to the history
|
||||||
|
|
||||||
###Changed
|
###Changed
|
||||||
@ -26,6 +26,7 @@
|
|||||||
- Icon alignment with dynamic width
|
- Icon alignment with dynamic width
|
||||||
- Loading each line of the configuration file no longer relies on a static size buffer
|
- Loading each line of the configuration file no longer relies on a static size buffer
|
||||||
- `ignore_newline` now works regardless of the markup setting
|
- `ignore_newline` now works regardless of the markup setting
|
||||||
|
- dmenu process being left as a zombie if no option was selected
|
||||||
|
|
||||||
##1.1.0 - 2014-07-29
|
##1.1.0 - 2014-07-29
|
||||||
- fix nasty memory leak
|
- fix nasty memory leak
|
||||||
|
@ -201,7 +201,7 @@ void context_menu(void)
|
|||||||
iter = iter->next) {
|
iter = iter->next) {
|
||||||
notification *n = iter->data;
|
notification *n = iter->data;
|
||||||
|
|
||||||
if(n->urls)
|
if (n->urls)
|
||||||
dmenu_input = string_append(dmenu_input, n->urls, "\n");
|
dmenu_input = string_append(dmenu_input, n->urls, "\n");
|
||||||
|
|
||||||
if (n->actions)
|
if (n->actions)
|
||||||
@ -252,13 +252,13 @@ void context_menu(void)
|
|||||||
close(child_io[1]);
|
close(child_io[1]);
|
||||||
|
|
||||||
size_t len = read(parent_io[0], buf, 1023);
|
size_t len = read(parent_io[0], buf, 1023);
|
||||||
|
|
||||||
|
waitpid(pid, NULL, 0);
|
||||||
|
|
||||||
if (len == 0) {
|
if (len == 0) {
|
||||||
g_free(dmenu_input);
|
g_free(dmenu_input);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int status;
|
|
||||||
waitpid(pid, &status, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
close(parent_io[0]);
|
close(parent_io[0]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user