daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
Blob Blame History Raw
From 855cfba6fb79066f46f02bbab09d498eda0d7cdd Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Thu, 13 Mar 2014 11:16:36 +0100
Subject: [PATCH] logind: uninitialized timer_fd is set to -1

---
 src/login/logind-session.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index b0e4bf6..730f11d 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -657,7 +657,7 @@ static int session_unlink_x11_socket(Session *s) {
 static void session_close_timer_fd(Session *s) {
         assert(s);
 
-        if (s->timer_fd <= 0)
+        if (s->timer_fd < 0)
                 return;
 
         hashmap_remove(s->manager->timer_fds, INT_TO_PTR(s->timer_fd + 1));