forked from external/yambar
module/script: close script communication pipe FD on error
This commit is contained in:
parent
fb0d443e1d
commit
7f1ffd126b
1 changed files with 2 additions and 0 deletions
|
@ -450,11 +450,13 @@ run(struct module *mod)
|
||||||
|
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
LOG_ERRNO("failed to read from pipe");
|
LOG_ERRNO("failed to read from pipe");
|
||||||
|
close(comm_pipe[0]);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r > 0) {
|
if (r > 0) {
|
||||||
LOG_ERRNO_P("%s: failed to start", _errno, m->path);
|
LOG_ERRNO_P("%s: failed to start", _errno, m->path);
|
||||||
|
close(comm_pipe[0]);
|
||||||
waitpid(pid, NULL, 0);
|
waitpid(pid, NULL, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue