From 0e9ddbb0bf0cd34500155ea4b03de2e2a38d8ab2 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Mon, 16 Mar 2020 23:33:42 +0100 Subject: Well I'm using Arch again --- slstatus/components/run_command.c | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 slstatus/components/run_command.c (limited to 'slstatus/components/run_command.c') 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 -#include - -#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; -} -- cgit v1.2.3