From: Timo Kokkonen Date: Wed, 26 Oct 2016 17:54:38 +0000 (+0300) Subject: built_in_parsers: Remove digitemp parser X-Git-Url: http://git.itanic.dy.fi/?p=rrdd;a=commitdiff_plain;h=2bd1b7df715e5757a3d831741658ab8715dfb89d built_in_parsers: Remove digitemp parser There are no users for this parser. Onewire parser replaces this one. Signed-off-by: Timo Kokkonen --- diff --git a/built_in_parsers.c b/built_in_parsers.c index 9a0d342..cce3f66 100644 --- a/built_in_parsers.c +++ b/built_in_parsers.c @@ -117,52 +117,6 @@ int cpu_mem_parser(char *data, const char **p) return 0; } -static int digitemp_parser(char *data, const char **p) -{ - const char digitemp_cmd[] = "/usr/bin/digitemp"; - char *const digitemp_args[] = { "", "-o2", "-a", "-q", 0 }; - FILE *readf; - int pid, ret; - float t1 = 0, t2 = 0, t3 = 0; - char buf[1024]; - - pid = run_piped_stream(digitemp_cmd, digitemp_args, 0, &readf, 0); - if (pid < 0) { - pr_err("Failed to parse digitemp\n"); - sprintf(data, "U:U"); - return -1; - } - - ret = fscanf(readf, "%f %f %f", &t1, &t2, &t3); - - if (ret != 3) { - pr_err("Failed to parse digitemp output: %m\n"); - sprintf(data, "U:U"); - return 1; - } - - t2 += 2.16; - t3 += -0.44; - - /* Read whatever the process might be still printing out */ - while (fgets(buf, 1024, readf)); - - clear_zombie(pid); - snprintf(data, RRD_DATA_MAX_LEN, "%.2f:%.2f", t3, t2); - return 0; -} - -static int digitemp_parser_mod(char *data, const char **p) -{ - char buf[1024]; - int ret; - - ret = digitemp_parser(buf, p); - snprintf(data, RRD_DATA_MAX_LEN, "U:%s", buf); - - return ret; -} - /* Run a command and feed the output from stdout directly to rrdtool */ static int script_parser(char *rrd_data, const char **parser_data) { @@ -299,14 +253,6 @@ static struct parser_info built_in_parsers[] = { .name = "cpu_mem", .parse = cpu_mem_parser, }, - { - .name = "digitemp", - .parse = digitemp_parser, - }, - { - .name = "digitemp_mod", - .parse = digitemp_parser_mod, - }, { .name = "script", .parse = script_parser,