[gdm] session-worker: don't run close() on negative fds



commit 84a330a1ecb657f0512715361c834e3324d6a724
Author: Ray Strode <rstrode redhat com>
Date:   Fri Oct 12 13:08:53 2012 -0400

    session-worker: don't run close() on negative fds
    
    There were two places in the code that run close()
    on fd's that failed to get opened.
    
    This commit fixes those two places.

 daemon/gdm-session-worker.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
---
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
index 1dfeee3..3acdfee 100644
--- a/daemon/gdm-session-worker.c
+++ b/daemon/gdm-session-worker.c
@@ -1644,8 +1644,6 @@ _open_program_session_log (const char *filename)
         if (fd < 0) {
                 char *temp_name;
 
-                close (fd);
-
                 temp_name = g_strdup_printf ("%s.XXXXXXXX", filename);
 
                 fd = g_mkstemp (temp_name);
@@ -1703,8 +1701,6 @@ _open_user_session_log (const char *dir)
         if (fd < 0) {
                 char *temp_name;
 
-                close (fd);
-
                 temp_name = g_strdup_printf ("%s.XXXXXXXX", filename);
 
                 fd = g_mkstemp (temp_name);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]