diff options
author | Marvin Borner | 2020-03-16 23:33:42 +0100 |
---|---|---|
committer | Marvin Borner | 2020-03-16 23:33:42 +0100 |
commit | 0e9ddbb0bf0cd34500155ea4b03de2e2a38d8ab2 (patch) | |
tree | 719da1c7fe5dabb872fe9ff1582c39b55ccd488e /slstatus/components/run_command.c | |
parent | e5d38956336ab1be954bdbd12808c5f98f8bd925 (diff) |
Well I'm using Arch again
Diffstat (limited to 'slstatus/components/run_command.c')
-rw-r--r-- | slstatus/components/run_command.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/slstatus/components/run_command.c b/slstatus/components/run_command.c deleted file mode 100644 index e00b478..0000000 --- a/slstatus/components/run_command.c +++ /dev/null @@ -1,30 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include <stdio.h> -#include <string.h> - -#include "../util.h" - -const char * -run_command(const char *cmd) -{ - char *p; - FILE *fp; - - if (!(fp = popen(cmd, "r"))) { - warn("popen '%s':", cmd); - return NULL; - } - p = fgets(buf, sizeof(buf) - 1, fp); - if (pclose(fp) < 0) { - warn("pclose '%s':", cmd); - return NULL; - } - if (!p) { - return NULL; - } - if ((p = strrchr(buf, '\n'))) { - p[0] = '\0'; - } - - return buf[0] ? buf : NULL; -} |