X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=src%2Feditfns.c;h=30b173d5150ff9efcf081e51a381d0d4b06bdff7;hp=e3dd7694afbabc9590547905ca0506f755711dd2;hb=afa9772e3fcbb4e80e3e4cfd1a40b4fccc6d08b8;hpb=7de03d6d03b52f49036eed2b6bb488112dc6ab05 diff --git a/src/editfns.c b/src/editfns.c index e3dd769..30b173d 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -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. */