summaryrefslogtreecommitdiff
path: root/src/gs-lock-plug.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2018-01-02 12:36:29 +0100
committermonsta <[email protected]>2018-09-22 14:11:44 +0300
commit7dfb29e0200a9fed0f91f51466305e1f3da00537 (patch)
tree22c6b0e41bee1239ae5be9e54a707ffbb4c78c9a /src/gs-lock-plug.c
parent7c095dcf7f28a37d15e574bd9356efb3c21318f5 (diff)
downloadmate-screensaver-7dfb29e0200a9fed0f91f51466305e1f3da00537.tar.bz2
mate-screensaver-7dfb29e0200a9fed0f91f51466305e1f3da00537.tar.xz
gs-lock-plug.c: Fix build warning:
ignoring return value of ‘fscanf’, declared with attribute warn_unused_result
Diffstat (limited to 'src/gs-lock-plug.c')
-rw-r--r--src/gs-lock-plug.c5
1 files changed, 4 insertions, 1 deletions
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);