summaryrefslogtreecommitdiff
path: root/components/run_command.c
diff options
context:
space:
mode:
authorLaslo Hunhold <dev@frign.de>2018-05-20 00:57:24 +0200
committerAaron Marcher <me@drkhsh.at>2018-05-20 01:01:26 +0200
commit5759bca6bfbc1e4f9166705d4d3eb8c5635d682d (patch)
tree7a1a00b2594f3e1d42519fb5920a6417d40f439f /components/run_command.c
parentdf3379b2590033b4a81d2e8bf2ec02df9df8e38f (diff)
Check return value of pclose()
Diffstat (limited to 'components/run_command.c')
-rw-r--r--components/run_command.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/components/run_command.c b/components/run_command.c
index b5eeff0..7ae1b69 100644
--- a/components/run_command.c
+++ b/components/run_command.c
@@ -16,7 +16,10 @@ run_command(const char *cmd)
return NULL;
}
p = fgets(buf, sizeof(buf) - 1, fp);
- pclose(fp);
+ if (pclose(fp) < 0) {
+ warn("pclose '%s':", cmd);
+ return NULL;
+ }
if (!p) {
return NULL;
}