]> git.eshelyaron.com Git - emacs.git/commitdiff
Include blockinput.h.
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Wed, 12 Jul 2006 08:37:25 +0000 (08:37 +0000)
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Wed, 12 Jul 2006 08:37:25 +0000 (08:37 +0000)
(Fuser_login_name, Fuser_full_name): Add BLOCK_INPUT around
getpwuid/getpwnam.

src/editfns.c

index cbaf1bb18ac86d54e7395128cd89ac32b4a47f2c..0761abd8d52e140a985dffd694f2b0db49eb2f00 100644 (file)
@@ -56,6 +56,7 @@ Boston, MA 02110-1301, USA.  */
 #include "coding.h"
 #include "frame.h"
 #include "window.h"
+#include "blockinput.h"
 
 #ifdef STDC_HEADERS
 #include <float.h>
@@ -1302,7 +1303,9 @@ with that uid, or nil if there is no such user.  */)
     return Vuser_login_name;
 
   CHECK_NUMBER (uid);
+  BLOCK_INPUT;
   pw = (struct passwd *) getpwuid (XINT (uid));
+  UNBLOCK_INPUT;
   return (pw ? build_string (pw->pw_name) : Qnil);
 }
 
@@ -1356,9 +1359,17 @@ name, or nil if there is no such user.  */)
   if (NILP (uid))
     return Vuser_full_name;
   else if (NUMBERP (uid))
-    pw = (struct passwd *) getpwuid ((uid_t) XFLOATINT (uid));
+    {
+      BLOCK_INPUT;
+      pw = (struct passwd *) getpwuid ((uid_t) XFLOATINT (uid));
+      UNBLOCK_INPUT;
+    }
   else if (STRINGP (uid))
-    pw = (struct passwd *) getpwnam (SDATA (uid));
+    {
+      BLOCK_INPUT;
+      pw = (struct passwd *) getpwnam (SDATA (uid));
+      UNBLOCK_INPUT;
+    }
   else
     error ("Invalid UID specification");