X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/80fc20d1d69b14f36ad9bb64d8af38481cbf1ff5..d1e33988227bf88c6bc33d4f83274dda78ee2310:/components/run_command.c diff --git a/components/run_command.c b/components/run_command.c index b5eeff0..e00b478 100644 --- a/components/run_command.c +++ b/components/run_command.c @@ -1,5 +1,4 @@ /* See LICENSE file for copyright and license details. */ -#include #include #include @@ -16,7 +15,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; }