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



commit 36d41d39c8122e8b6494e61ef855b23276247a39
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.
    (cherry picked from commit 84a330a1ecb657f0512715361c834e3324d6a724)

 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]