diff options
| author | YAMAMOTO Mitsuharu | 2006-07-12 08:37:25 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2006-07-12 08:37:25 +0000 |
| commit | b91834c328d3b310e3ebb7094c926e3f4787f07b (patch) | |
| tree | adc8c27087d73bdefdfb9494f2cc4399cbd3f4ae /src | |
| parent | 8c8a7c58e3d8c25a2acedf7af34c627850736dc1 (diff) | |
| download | emacs-b91834c328d3b310e3ebb7094c926e3f4787f07b.tar.gz emacs-b91834c328d3b310e3ebb7094c926e3f4787f07b.zip | |
Include blockinput.h.
(Fuser_login_name, Fuser_full_name): Add BLOCK_INPUT around
getpwuid/getpwnam.
Diffstat (limited to 'src')
| -rw-r--r-- | src/editfns.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/editfns.c b/src/editfns.c index cbaf1bb18ac..0761abd8d52 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -56,6 +56,7 @@ Boston, MA 02110-1301, USA. */ | |||
| 56 | #include "coding.h" | 56 | #include "coding.h" |
| 57 | #include "frame.h" | 57 | #include "frame.h" |
| 58 | #include "window.h" | 58 | #include "window.h" |
| 59 | #include "blockinput.h" | ||
| 59 | 60 | ||
| 60 | #ifdef STDC_HEADERS | 61 | #ifdef STDC_HEADERS |
| 61 | #include <float.h> | 62 | #include <float.h> |
| @@ -1302,7 +1303,9 @@ with that uid, or nil if there is no such user. */) | |||
| 1302 | return Vuser_login_name; | 1303 | return Vuser_login_name; |
| 1303 | 1304 | ||
| 1304 | CHECK_NUMBER (uid); | 1305 | CHECK_NUMBER (uid); |
| 1306 | BLOCK_INPUT; | ||
| 1305 | pw = (struct passwd *) getpwuid (XINT (uid)); | 1307 | pw = (struct passwd *) getpwuid (XINT (uid)); |
| 1308 | UNBLOCK_INPUT; | ||
| 1306 | return (pw ? build_string (pw->pw_name) : Qnil); | 1309 | return (pw ? build_string (pw->pw_name) : Qnil); |
| 1307 | } | 1310 | } |
| 1308 | 1311 | ||
| @@ -1356,9 +1359,17 @@ name, or nil if there is no such user. */) | |||
| 1356 | if (NILP (uid)) | 1359 | if (NILP (uid)) |
| 1357 | return Vuser_full_name; | 1360 | return Vuser_full_name; |
| 1358 | else if (NUMBERP (uid)) | 1361 | else if (NUMBERP (uid)) |
| 1359 | pw = (struct passwd *) getpwuid ((uid_t) XFLOATINT (uid)); | 1362 | { |
| 1363 | BLOCK_INPUT; | ||
| 1364 | pw = (struct passwd *) getpwuid ((uid_t) XFLOATINT (uid)); | ||
| 1365 | UNBLOCK_INPUT; | ||
| 1366 | } | ||
| 1360 | else if (STRINGP (uid)) | 1367 | else if (STRINGP (uid)) |
| 1361 | pw = (struct passwd *) getpwnam (SDATA (uid)); | 1368 | { |
| 1369 | BLOCK_INPUT; | ||
| 1370 | pw = (struct passwd *) getpwnam (SDATA (uid)); | ||
| 1371 | UNBLOCK_INPUT; | ||
| 1372 | } | ||
| 1362 | else | 1373 | else |
| 1363 | error ("Invalid UID specification"); | 1374 | error ("Invalid UID specification"); |
| 1364 | 1375 | ||