From 64d47ad9e43da564ea4c2b2ae2dd4b1ca22a8770 Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Tue, 2 Jan 2018 12:36:29 +0100 Subject: gs-lock-plug.c: Fix build warning: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ignoring return value of ‘fscanf’, declared with attribute warn_unused_result --- src/gs-lock-plug.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c index 4069b11..07993c5 100644 --- a/src/gs-lock-plug.c +++ b/src/gs-lock-plug.c @@ -190,7 +190,10 @@ process_is_running (const char * name) int num_processes; gchar *command = g_strdup_printf ("pidof %s | wc -l", name); FILE *fp = popen(command, "r"); - fscanf(fp, "%d", &num_processes); + + if (fscanf(fp, "%d", &num_processes) != 1) + num_processes = 0; + pclose(fp); g_free (command); -- cgit v1.2.1