diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gs-lock-plug.c | 5 |
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); |