Re: [gdm-list] Fixes for ConsoleKit and GDM 2.21 for Solaris



Hi,

+#ifdef ENABLE_RBAC_SHUTDOWN
+static char *
+get_user_name (uid_t uid)
+{
+        struct passwd *pwent;
+        char          *name;
+
+        name = NULL;
+
+        pwent = getpwuid (uid);
+
+        if (pwent != NULL) {
+                name = g_strdup (pwent->pw_name);
+        }
+
+        return name;
+}
+#endif
+
You could drop this function and just use g_get_user_name().

(since you only ever call it with getuid() as the argument)

Note the semantics of g_get_user_name() are a little different, in
that you don't g_free() the result.

--Ray


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