summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2018-01-03 16:25:02 +0100
committerPablo Barciela <[email protected]>2018-01-03 16:25:02 +0100
commit171fc61b7cc160b915b4973d81e11a4431d4fcfb (patch)
treef9d25ee7143d4f7aa55909036a531202aade4335
parent1fd2ddf6c1c60c8a7c2cb915becdfbeea56787d8 (diff)
downloadmate-session-manager-171fc61b7cc160b915b4973d81e11a4431d4fcfb.tar.bz2
mate-session-manager-171fc61b7cc160b915b4973d81e11a4431d4fcfb.tar.xz
gsm-manager.c: Fix build warning:
ignoring return value of ‘fscanf’, declared with attribute warn_unused_result
-rw-r--r--mate-session/gsm-manager.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mate-session/gsm-manager.c b/mate-session/gsm-manager.c
index f76c235..96205b1 100644
--- a/mate-session/gsm-manager.c
+++ b/mate-session/gsm-manager.c
@@ -1035,7 +1035,10 @@ process_is_running (const char * name)
int num_processes;
char * 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);