summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sesman/sesman.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sesman/sesman.c b/sesman/sesman.c
index 3dc96881..b3f83f9c 100644
--- a/sesman/sesman.c
+++ b/sesman/sesman.c
@@ -148,9 +148,11 @@ main(int argc, char** argv)
}
error = g_file_read(fd, pid_s, 7);
- if (0 != error)
+ if (-1 == error)
{
g_printf("error reading pid file: %s\n", g_get_strerror());
+ g_file_close(fd);
+ g_exit(error);
}
g_file_close(fd);
pid = g_atoi(pid_s);