projects
/
suckless
/
slstatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c12b9cc
)
Check return value of pclose()
author
Laslo Hunhold
<dev@frign.de>
Sat, 19 May 2018 22:57:24 +0000
(
00:57
+0200)
committer
Aaron Marcher
<me@drkhsh.at>
Sat, 19 May 2018 23:01:26 +0000
(
01:01
+0200)
components/run_command.c
patch
|
blob
|
history
diff --git
a/components/run_command.c
b/components/run_command.c
index b5eeff0a6749d5f45b8bb4b313465213e81b914e..7ae1b69f7e4b57923218578f7a9d728bbc4655f5 100644
(file)
--- 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;
}