XEmacs 21.2.22 "Mercedes".
[chise/xemacs-chise.git.1] / src / editfns.c
index e3dd769..30b173d 100644 (file)
@@ -66,8 +66,6 @@ Lisp_Object Vuser_login_name; /* user name from LOGNAME or USER.  */
 Lisp_Object Vuser_full_name;
 EXFUN (Fuser_full_name, 1);
 
-char *get_system_name (void);
-
 Lisp_Object Qformat;
 
 Lisp_Object Qpoint, Qmark, Qregion_beginning, Qregion_end;
@@ -639,17 +637,17 @@ ignored and this function returns the login name for that UID, or nil.
        (uid))
 {
   char *returned_name;
-  int local_uid;
+  uid_t local_uid;
 
   if (!NILP (uid))
     {
       CHECK_INT (uid);
-      local_uid = XINT(uid);
-      returned_name = user_login_name(&local_uid);
+      local_uid = XINT (uid);
+      returned_name = user_login_name (&local_uid);
     }
   else
     {
-      returned_name = user_login_name(NULL);
+      returned_name = user_login_name (NULL);
     }
   /* #### - I believe this should return nil instead of "unknown" when pw==0
      pw=0 is indicated by a null return from user_login_name
@@ -665,14 +663,12 @@ ignored and this function returns the login name for that UID, or nil.
    corresponds to a nil argument to Fuser_login_name.
 */
 char*
-user_login_name (int *uid)
+user_login_name (uid_t *uid)
 {
-  struct passwd *pw = NULL;
-
   /* uid == NULL to return name of this user */
   if (uid != NULL)
     {
-      pw = getpwuid (*uid);
+      struct passwd *pw = getpwuid (*uid);
       return pw ? pw->pw_name : NULL;
     }
   else
@@ -693,7 +689,7 @@ user_login_name (int *uid)
        return (user_name);
       else
        {
-         pw = getpwuid (geteuid ());
+         struct passwd *pw = getpwuid (geteuid ());
 #ifdef __CYGWIN32__
          /* Since the Cygwin environment may not have an /etc/passwd,
             return "unknown" instead of the null if the username
@@ -913,14 +909,6 @@ Return the name of the machine you are running on, as a string.
     return Fcopy_sequence (Vsystem_name);
 }
 
-/* For the benefit of callers who don't want to include lisp.h.
-   Caller must free! */
-char *
-get_system_name (void)
-{
-  return xstrdup ((char *) XSTRING_DATA (Vsystem_name));
-}
-
 DEFUN ("emacs-pid", Femacs_pid, 0, 0, 0, /*
 Return the process ID of Emacs, as an integer.
 */