[gdm/gnome-2-30] Fix up new getpw*() wrappers



commit baf91fafe6aaf00697098cd569b8ee4c95d81c41
Author: Ray Strode <rstrode redhat com>
Date:   Fri Jul 2 11:46:25 2010 -0400

    Fix up new getpw*() wrappers
    
    Their logic was a little wrong, causing infinite loops.

 common/gdm-common.c                   |    2 +-
 gui/simple-greeter/gdm-user-manager.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/common/gdm-common.c b/common/gdm-common.c
index 1b344f3..adc42e6 100644
--- a/common/gdm-common.c
+++ b/common/gdm-common.c
@@ -83,7 +83,7 @@ gdm_get_pwent_for_name (const char     *name,
         do {
                 errno = 0;
                 pwent = getpwnam (name);
-        } while (errno != EINTR);
+        } while (pwent == NULL && errno == EINTR);
 
         if (pwentp != NULL) {
                 *pwentp = pwent;
diff --git a/gui/simple-greeter/gdm-user-manager.c b/gui/simple-greeter/gdm-user-manager.c
index b0fd88a..9cb00a5 100644
--- a/gui/simple-greeter/gdm-user-manager.c
+++ b/gui/simple-greeter/gdm-user-manager.c
@@ -1007,7 +1007,7 @@ get_pwent_for_name (const char     *name,
         do {
                 errno = 0;
                 pwent = getpwnam (name);
-        } while (errno != EINTR);
+        } while (pwent == NULL && errno == EINTR);
 
         if (pwentp != NULL) {
                 *pwentp = pwent;
@@ -1025,7 +1025,7 @@ get_pwent_for_uid (uid_t           uid,
         do {
                 errno = 0;
                 pwent = getpwuid (uid);
-        } while (errno != EINTR);
+        } while (pwent == NULL && errno == EINTR);
 
         if (pwentp != NULL) {
                 *pwentp = pwent;



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