aboutsummaryrefslogtreecommitdiffstats
path: root/src/editfns.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/editfns.c b/src/editfns.c
index acf9c48e7a0..fc6465a3d46 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1219,9 +1219,9 @@ of the user with that uid, or nil if there is no such user. */)
1219 return Vuser_login_name; 1219 return Vuser_login_name;
1220 1220
1221 CONS_TO_INTEGER (uid, uid_t, id); 1221 CONS_TO_INTEGER (uid, uid_t, id);
1222 BLOCK_INPUT; 1222 block_input ();
1223 pw = getpwuid (id); 1223 pw = getpwuid (id);
1224 UNBLOCK_INPUT; 1224 unblock_input ();
1225 return (pw ? build_string (pw->pw_name) : Qnil); 1225 return (pw ? build_string (pw->pw_name) : Qnil);
1226} 1226}
1227 1227
@@ -1279,15 +1279,15 @@ name, or nil if there is no such user. */)
1279 { 1279 {
1280 uid_t u; 1280 uid_t u;
1281 CONS_TO_INTEGER (uid, uid_t, u); 1281 CONS_TO_INTEGER (uid, uid_t, u);
1282 BLOCK_INPUT; 1282 block_input ();
1283 pw = getpwuid (u); 1283 pw = getpwuid (u);
1284 UNBLOCK_INPUT; 1284 unblock_input ();
1285 } 1285 }
1286 else if (STRINGP (uid)) 1286 else if (STRINGP (uid))
1287 { 1287 {
1288 BLOCK_INPUT; 1288 block_input ();
1289 pw = getpwnam (SSDATA (uid)); 1289 pw = getpwnam (SSDATA (uid));
1290 UNBLOCK_INPUT; 1290 unblock_input ();
1291 } 1291 }
1292 else 1292 else
1293 error ("Invalid UID specification"); 1293 error ("Invalid UID specification");
@@ -1763,14 +1763,14 @@ format_time_string (char const *format, ptrdiff_t formatlen,
1763 while (1) 1763 while (1)
1764 { 1764 {
1765 time_t *taddr = emacs_secs_addr (&t); 1765 time_t *taddr = emacs_secs_addr (&t);
1766 BLOCK_INPUT; 1766 block_input ();
1767 1767
1768 synchronize_system_time_locale (); 1768 synchronize_system_time_locale ();
1769 1769
1770 tm = ut ? gmtime (taddr) : localtime (taddr); 1770 tm = ut ? gmtime (taddr) : localtime (taddr);
1771 if (! tm) 1771 if (! tm)
1772 { 1772 {
1773 UNBLOCK_INPUT; 1773 unblock_input ();
1774 time_overflow (); 1774 time_overflow ();
1775 } 1775 }
1776 *tmp = *tm; 1776 *tmp = *tm;
@@ -1782,14 +1782,14 @@ format_time_string (char const *format, ptrdiff_t formatlen,
1782 1782
1783 /* Buffer was too small, so make it bigger and try again. */ 1783 /* Buffer was too small, so make it bigger and try again. */
1784 len = emacs_nmemftime (NULL, SIZE_MAX, format, formatlen, tm, ut, ns); 1784 len = emacs_nmemftime (NULL, SIZE_MAX, format, formatlen, tm, ut, ns);
1785 UNBLOCK_INPUT; 1785 unblock_input ();
1786 if (STRING_BYTES_BOUND <= len) 1786 if (STRING_BYTES_BOUND <= len)
1787 string_overflow (); 1787 string_overflow ();
1788 size = len + 1; 1788 size = len + 1;
1789 buf = SAFE_ALLOCA (size); 1789 buf = SAFE_ALLOCA (size);
1790 } 1790 }
1791 1791
1792 UNBLOCK_INPUT; 1792 unblock_input ();
1793 bufstring = make_unibyte_string (buf, len); 1793 bufstring = make_unibyte_string (buf, len);
1794 SAFE_FREE (); 1794 SAFE_FREE ();
1795 return code_convert_string_norecord (bufstring, Vlocale_coding_system, 0); 1795 return code_convert_string_norecord (bufstring, Vlocale_coding_system, 0);
@@ -1817,11 +1817,11 @@ DOW and ZONE.) */)
1817 struct tm *decoded_time; 1817 struct tm *decoded_time;
1818 Lisp_Object list_args[9]; 1818 Lisp_Object list_args[9];
1819 1819
1820 BLOCK_INPUT; 1820 block_input ();
1821 decoded_time = localtime (&time_spec); 1821 decoded_time = localtime (&time_spec);
1822 if (decoded_time) 1822 if (decoded_time)
1823 save_tm = *decoded_time; 1823 save_tm = *decoded_time;
1824 UNBLOCK_INPUT; 1824 unblock_input ();
1825 if (! (decoded_time 1825 if (! (decoded_time
1826 && MOST_NEGATIVE_FIXNUM - TM_YEAR_BASE <= save_tm.tm_year 1826 && MOST_NEGATIVE_FIXNUM - TM_YEAR_BASE <= save_tm.tm_year
1827 && save_tm.tm_year <= MOST_POSITIVE_FIXNUM - TM_YEAR_BASE)) 1827 && save_tm.tm_year <= MOST_POSITIVE_FIXNUM - TM_YEAR_BASE))
@@ -1837,13 +1837,13 @@ DOW and ZONE.) */)
1837 XSETFASTINT (list_args[6], save_tm.tm_wday); 1837 XSETFASTINT (list_args[6], save_tm.tm_wday);
1838 list_args[7] = save_tm.tm_isdst ? Qt : Qnil; 1838 list_args[7] = save_tm.tm_isdst ? Qt : Qnil;
1839 1839
1840 BLOCK_INPUT; 1840 block_input ();
1841 decoded_time = gmtime (&time_spec); 1841 decoded_time = gmtime (&time_spec);
1842 if (decoded_time == 0) 1842 if (decoded_time == 0)
1843 list_args[8] = Qnil; 1843 list_args[8] = Qnil;
1844 else 1844 else
1845 XSETINT (list_args[8], tm_diff (&save_tm, decoded_time)); 1845 XSETINT (list_args[8], tm_diff (&save_tm, decoded_time));
1846 UNBLOCK_INPUT; 1846 unblock_input ();
1847 return Flist (9, list_args); 1847 return Flist (9, list_args);
1848} 1848}
1849 1849
@@ -1901,9 +1901,9 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
1901 zone = XCAR (zone); 1901 zone = XCAR (zone);
1902 if (NILP (zone)) 1902 if (NILP (zone))
1903 { 1903 {
1904 BLOCK_INPUT; 1904 block_input ();
1905 value = mktime (&tm); 1905 value = mktime (&tm);
1906 UNBLOCK_INPUT; 1906 unblock_input ();
1907 } 1907 }
1908 else 1908 else
1909 { 1909 {
@@ -1928,7 +1928,7 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
1928 else 1928 else
1929 error ("Invalid time zone specification"); 1929 error ("Invalid time zone specification");
1930 1930
1931 BLOCK_INPUT; 1931 block_input ();
1932 1932
1933 /* Set TZ before calling mktime; merely adjusting mktime's returned 1933 /* Set TZ before calling mktime; merely adjusting mktime's returned
1934 value doesn't suffice, since that would mishandle leap seconds. */ 1934 value doesn't suffice, since that would mishandle leap seconds. */
@@ -1942,7 +1942,7 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
1942#ifdef LOCALTIME_CACHE 1942#ifdef LOCALTIME_CACHE
1943 tzset (); 1943 tzset ();
1944#endif 1944#endif
1945 UNBLOCK_INPUT; 1945 unblock_input ();
1946 1946
1947 xfree (newenv); 1947 xfree (newenv);
1948 } 1948 }
@@ -1978,7 +1978,7 @@ but this is considered obsolete. */)
1978 newline, and without the 4-digit year limit. Don't use asctime 1978 newline, and without the 4-digit year limit. Don't use asctime
1979 or ctime, as they might dump core if the year is outside the 1979 or ctime, as they might dump core if the year is outside the
1980 range -999 .. 9999. */ 1980 range -999 .. 9999. */
1981 BLOCK_INPUT; 1981 block_input ();
1982 tm = localtime (&value); 1982 tm = localtime (&value);
1983 if (tm) 1983 if (tm)
1984 { 1984 {
@@ -1994,7 +1994,7 @@ but this is considered obsolete. */)
1994 tm->tm_hour, tm->tm_min, tm->tm_sec, 1994 tm->tm_hour, tm->tm_min, tm->tm_sec,
1995 tm->tm_year + year_base); 1995 tm->tm_year + year_base);
1996 } 1996 }
1997 UNBLOCK_INPUT; 1997 unblock_input ();
1998 if (! tm) 1998 if (! tm)
1999 time_overflow (); 1999 time_overflow ();
2000 2000
@@ -2050,11 +2050,11 @@ the data it can't find. */)
2050 zone_offset = Qnil; 2050 zone_offset = Qnil;
2051 value = make_emacs_time (lisp_seconds_argument (specified_time), 0); 2051 value = make_emacs_time (lisp_seconds_argument (specified_time), 0);
2052 zone_name = format_time_string ("%Z", sizeof "%Z" - 1, value, 0, &localtm); 2052 zone_name = format_time_string ("%Z", sizeof "%Z" - 1, value, 0, &localtm);
2053 BLOCK_INPUT; 2053 block_input ();
2054 t = gmtime (emacs_secs_addr (&value)); 2054 t = gmtime (emacs_secs_addr (&value));
2055 if (t) 2055 if (t)
2056 offset = tm_diff (&localtm, t); 2056 offset = tm_diff (&localtm, t);
2057 UNBLOCK_INPUT; 2057 unblock_input ();
2058 2058
2059 if (t) 2059 if (t)
2060 { 2060 {
@@ -2101,7 +2101,7 @@ only the former. */)
2101 if (! (NILP (tz) || EQ (tz, Qt))) 2101 if (! (NILP (tz) || EQ (tz, Qt)))
2102 CHECK_STRING (tz); 2102 CHECK_STRING (tz);
2103 2103
2104 BLOCK_INPUT; 2104 block_input ();
2105 2105
2106 /* When called for the first time, save the original TZ. */ 2106 /* When called for the first time, save the original TZ. */
2107 old_environbuf = environbuf; 2107 old_environbuf = environbuf;
@@ -2118,7 +2118,7 @@ only the former. */)
2118 set_time_zone_rule (tzstring); 2118 set_time_zone_rule (tzstring);
2119 environbuf = environ; 2119 environbuf = environ;
2120 2120
2121 UNBLOCK_INPUT; 2121 unblock_input ();
2122 2122
2123 xfree (old_environbuf); 2123 xfree (old_environbuf);
2124 return Qnil; 2124 return Qnil;