diff options
| author | Paul Eggert | 1999-10-19 07:25:11 +0000 |
|---|---|---|
| committer | Paul Eggert | 1999-10-19 07:25:11 +0000 |
| commit | 68c45bf06516ed4650eb7f9f617742d84750600a (patch) | |
| tree | 8eed6fd2d1f6112b2bea449f86397ad0447836ab /src/process.c | |
| parent | 0f0912e6442b71ed549b625bfc694581787da97e (diff) | |
| download | emacs-68c45bf06516ed4650eb7f9f617742d84750600a.tar.gz emacs-68c45bf06516ed4650eb7f9f617742d84750600a.zip | |
Add support for large files, 64-bit Solaris, system locale codings.
* Makefile.in (emacs): Set the LC_ALL environment variable to "C"
when dumping, so that the dumped Emacs doesn't have stray locale info.
(dired.o): Depend on systime.h.
(editfns.o): Depend on coding.h.
* alloc.c, buffer.c, callproc.c, ccl.c, charset.c, coding.c, data.c,
dispnew.c, editfns.c, emacs.c, filelock.c, floatfns.c, hftctl.c,
keyboard.c, process.c, sysdep.c, unexelf.c, unexhp9k800.c,
unexsunos4.c, vmsfns.c, vmsgmalloc.c, w32faces.c, w32menu.c, w32term.c,
w32xfns.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
Include <config.h> before any system include files.
* alloc.c, buffer.c, ccl.c, data.c, editfns.c, emacs.c, eval.c,
fileio.c, filelock.c, frame.c, insdel.c, keymap.c, lread.c,
m/alpha.h, print.c, search.c, sysdep.c, xdisp.c, xfaces.c, xfns.c,
xmenu.c, xterm.c:
Do not include <stdlib.h>, as <config.h> does this now.
* callproc.c (Fcall_process):
Synchronize messages locale before invoking strerror.
Decode resulting string with locale-coding-system.
* coding.c (Vlocale_coding_system): New var.
(syms_of_coding): Adjust to above change.
(emacs_strerror): New function.
* coding.h (emacs_strerror, Vlocale_coding_system): New decls.
* config.in (HAVE_STDIO_EXT_H, HAVE_TM_GMTOFF, HAVE___FPENDING,
HAVE_FTELLO, HAVE_GETLOADAVG, HAVE_MBLEN, HAVE_MBRLEN,
HAVE_STRSIGNAL): New macros.
(BITS_PER_LONG): Default to 64 if _LP64 is defined.
<stdlib.h>: Include if HAVE_STDLIB_H is defined and NOT_C_CODE isn't.
* dired.c: Include "systime.h".
(Ffile_attributes): Do not cast s.st_size to int; this loses
information if int is 32 bits but st_size and EMACS_INT are larger.
Treat large device numbers like large inode numbers.
* dispnew.c (PENDING_OUTPUT_COUNT): Use __fpending if available.
* editfns.c: Include coding.h.
(emacs_strftime): Remove decl.
(emacs_strftimeu): New decl.
(emacs_memftimeu): Renamed from emacs_memftime; new arg UT.
Use emacs_strftimeu instead of emacs_strftime.
(Fformat_time_string): Convert format string using
Vlocale_coding_system, and convert result back. Synchronize time
locale before invoking lower level function. Invoke
emacs_memftimeu, passing ut, instead of emacs_memftime.
* emacs.c: Include <locale.h> if HAVE_SETLOCALE is defined.
(Vmessages_locale, Vprevious_messages_locale, Vtime_locale,
Vprevious_time_locale): New variables.
(main): Invoke setlocale early, so that initial error messages are
localized properly. But skip locale-setting if LC_ALL is "C".
Fix up locale when it's safe to do so.
(fixup_locale): Moved here from xterm.c.
(synchronize_locale, synchronize_time_locale,
synchronize_messages_locale): New functions.
(syms_of_emacs): Accommodate above changes.
* fileio.c (report_file_error): Convert strerror output according
to Vlocale_coding_system.
(Finsert_file_contents): Check for arithmetic overflow in
computations that depend on file size. Report IO errors
with emacs_strerror, not strerror.
* fns.c (Fgethash): Declare dflt parameter.
* gmalloc.c: Do not define const to nothing if HAVE_CONFIG_H
is defined; that's config.h's job.
* lisp.h (EMACS_INT, BITS_PER_EMACS_INT, EMACS_UINT): If _LP64,
default these values to long, BITS_PER_LONG, and unsigned long.
(VALBITS, MARKBIT, XINT): Do not assume 32-bit EMACS_INT.
(PNTR_COMPARISON_TYPE): Default to EMACS_UINT, not to unsigned int.
(code_convert_string_norecord, fixup_locale,
synchronize_messages_locale, synchronize_time_locale,
emacs_open, emacs_close, emacs_read, emacs_write): New decls.
All Emacs callers of open, close, read, write changed to use
emacs_open, emacs_close, emacs_read, emacs_write.
* lread.c (file_offset, file_tell): New macros. All uses of ftell
changed to file_tell.
(saved_doc_string_position, prev_saved_doc_string_position): Now
of type file_offset.
(init_lread): Do not fix locale here; fixup_locale now does this.
* m/amdahl.h, s/usg5-4.h:
(NSIG): Remove.
(NSIG_MINIMUM): New macro.
* m/cydra5.h, m/dpx2.h, m/mips.h, m/pfa50.h, m/sps7.h, m/stride.h,
m/ustation.h, s/gnu-linux.h, s/hpux.h, s/iris3-5.h, s/iris3-6.h,
s/umips.h, s/usg5-4.h:
(SIGIO): Do not undef.
(BROKEN_SIGIO): New macro.
* m/ustation.h:
(SIGTSTP): Do not undef.
(BROKEN_SIGTSTP): New macro.
* s/gnu-linux.h:
(SIGPOLL, SIGURG): Do not undef.
(BROKEN_SIGPOLL, BROKEN_SIGURG): New macros.
* s/ptx4.h:
(SIGINFO): Do not undef.
(BROKEN_SIGINFO): New macros.
* m/delta.h, s/ptx.h, s/template.h: Doc fix.
* mktime.c, strftime.c: Update to glibc 2.1.2 version, with
some Emacs-related changes merged.
* print.c (float_to_string): Prepend "-" to representation of a
NaN if the NaN is negative.
* process.c (sys_siglist): Omit if HAVE_STRSIGNAL.
(wait_reading_process_input): Use emacs_strerror, not strerror.
* process.c (status_message, sigchld_handler): Synchronize locale,
then use strsignal istead of sys_siglist.
* w32proc.c (sys_wait): Likewise.
* s/aix3-1.h, s/bsd4-1.h, s/dgux.h, s/gnu-linux.h, s/hiuxmpp.h,
s/hpux.h, s/iris3-5.h, s/iris3-6.h, s/irix3-3.h, s/osf1.h, s/rtu.h,
s/sunos4-1.h, s/unipl5-0.h, s/unipl5-2.h, s/usg5-0.h, s/usg5-2-2.h,
s/usg5-2.h, s/usg5-3.h, s/xenix.h:
(open, close, read, write, INTERRUPTIBLE_OPEN,
INTERRUPTIBLE_CLOSE, INTERRUPTIBLE_IO): Remove.
* s/sol2-5.h (_LARGEFILE_SOURCE, _FILE_OFFSET_BITS): New macros.
* sysdep.c (sys_read, sys_write, read, write, sys_close, close,
sys_open, open): Remove.
(emacs_open, emacs_close, emacs_read, emacs_write): Always define;
the old INTERRUPTIBLE_OPEN, INTERRUPTIBLE_CLOSE, and INTERRUPTIBLE_IO
macros are no longer used.
(emacs_open): Renamed from sys_open. Merge BSD4_1 version.
(emacs_close): Renamed from sys_close.
(emacs_read): Renamed from sys_read.
(emacs_write): Renamed from sys_write.
(sys_siglist): Do not declare if HAVE_STRSIGNAL.
(dup2): Do not print error on failure; the real dup2 doesn't.
(strsignal): New function, defined if !HAVE_STRSIGNAL.
* syssignal.h (SIGINFO): Undef if defined and if BROKEN_SIGINFO
is defined.
(SIGIO, SIGPOLL, SIGTSTP, SIGURG): Likewise.
(NSIG): If less than NSIG_MINIMUM, define to NSIG_MINIMUM.
(strsignal): Declare if !HAVE_STRSIGNAL.
* unexelf.c (ElfBitsW, ELFSIZE, ElfExpandBitsW): New macros.
(ElfW): Define in terms of ElfExpandBitsW.
* w32proc.c (sys_siglist): Remove decl.
* xdisp.c (decode_mode_spec): 3rd arg is int, not char, to comply
with ANSI C.
(display_string): Declare face_string_pos arg.
* xfns.c (Fx_show_tip): Declare timeout param.
* xterm.c: No need to include locale.h.
(x_alloc_lighter_color, x_setup_relief_color):
Pass arg as double, not float, for compatibility with ANSI C.
(fixup_locale): Move to emacs.c.
(x_term_init): Do not setlocale or fixup locale; the main program
does this now.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 108 |
1 files changed, 49 insertions, 59 deletions
diff --git a/src/process.c b/src/process.c index d2804763e3d..144e69af7c6 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Asynchronous subprocess control for GNU Emacs. | 1 | /* Asynchronous subprocess control for GNU Emacs. |
| 2 | Copyright (C) 1985, 86, 87, 88, 93, 94, 95, 96, 1998 | 2 | Copyright (C) 1985, 86, 87, 88, 93, 94, 95, 96, 98, 1999 |
| 3 | Free Software Foundation, Inc. | 3 | Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| @@ -20,10 +20,10 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |||
| 20 | Boston, MA 02111-1307, USA. */ | 20 | Boston, MA 02111-1307, USA. */ |
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | #include <signal.h> | ||
| 24 | |||
| 25 | #include <config.h> | 23 | #include <config.h> |
| 26 | 24 | ||
| 25 | #include <signal.h> | ||
| 26 | |||
| 27 | /* This file is split into two parts by the following preprocessor | 27 | /* This file is split into two parts by the following preprocessor |
| 28 | conditional. The 'then' clause contains all of the support for | 28 | conditional. The 'then' clause contains all of the support for |
| 29 | asynchronous subprocesses. The 'else' clause contains stub | 29 | asynchronous subprocesses. The 'else' clause contains stub |
| @@ -155,6 +155,7 @@ extern char *sys_errlist[]; | |||
| 155 | extern int h_errno; | 155 | extern int h_errno; |
| 156 | #endif | 156 | #endif |
| 157 | 157 | ||
| 158 | #ifndef HAVE_STRSIGNAL | ||
| 158 | #ifndef SYS_SIGLIST_DECLARED | 159 | #ifndef SYS_SIGLIST_DECLARED |
| 159 | #ifndef VMS | 160 | #ifndef VMS |
| 160 | #ifndef BSD4_1 | 161 | #ifndef BSD4_1 |
| @@ -196,6 +197,7 @@ char *sys_siglist[] = | |||
| 196 | #endif | 197 | #endif |
| 197 | #endif /* VMS */ | 198 | #endif /* VMS */ |
| 198 | #endif /* ! SYS_SIGLIST_DECLARED */ | 199 | #endif /* ! SYS_SIGLIST_DECLARED */ |
| 200 | #endif /* ! HAVE_STRSIGNAL */ | ||
| 199 | 201 | ||
| 200 | /* t means use pty, nil means use a pipe, | 202 | /* t means use pty, nil means use a pipe, |
| 201 | maybe other values to come. */ | 203 | maybe other values to come. */ |
| @@ -357,16 +359,9 @@ status_message (status) | |||
| 357 | 359 | ||
| 358 | if (EQ (symbol, Qsignal) || EQ (symbol, Qstop)) | 360 | if (EQ (symbol, Qsignal) || EQ (symbol, Qstop)) |
| 359 | { | 361 | { |
| 360 | char *signame = 0; | 362 | char *signame; |
| 361 | if (code < NSIG) | 363 | synchronize_messages_locale (); |
| 362 | { | 364 | signame = strsignal (code); |
| 363 | #ifndef VMS | ||
| 364 | /* Cast to suppress warning if the table has const char *. */ | ||
| 365 | signame = (char *) sys_siglist[code]; | ||
| 366 | #else | ||
| 367 | signame = sys_errlist[code]; | ||
| 368 | #endif | ||
| 369 | } | ||
| 370 | if (signame == 0) | 365 | if (signame == 0) |
| 371 | signame = "unknown"; | 366 | signame = "unknown"; |
| 372 | string = build_string (signame); | 367 | string = build_string (signame); |
| @@ -426,7 +421,7 @@ allocate_pty () | |||
| 426 | #else /* no PTY_OPEN */ | 421 | #else /* no PTY_OPEN */ |
| 427 | #ifdef IRIS | 422 | #ifdef IRIS |
| 428 | /* Unusual IRIS code */ | 423 | /* Unusual IRIS code */ |
| 429 | *ptyv = open ("/dev/ptc", O_RDWR | O_NDELAY, 0); | 424 | *ptyv = emacs_open ("/dev/ptc", O_RDWR | O_NDELAY, 0); |
| 430 | if (fd < 0) | 425 | if (fd < 0) |
| 431 | return -1; | 426 | return -1; |
| 432 | if (fstat (fd, &stb) < 0) | 427 | if (fstat (fd, &stb) < 0) |
| @@ -441,9 +436,9 @@ allocate_pty () | |||
| 441 | else | 436 | else |
| 442 | failed_count = 0; | 437 | failed_count = 0; |
| 443 | #ifdef O_NONBLOCK | 438 | #ifdef O_NONBLOCK |
| 444 | fd = open (pty_name, O_RDWR | O_NONBLOCK, 0); | 439 | fd = emacs_open (pty_name, O_RDWR | O_NONBLOCK, 0); |
| 445 | #else | 440 | #else |
| 446 | fd = open (pty_name, O_RDWR | O_NDELAY, 0); | 441 | fd = emacs_open (pty_name, O_RDWR | O_NDELAY, 0); |
| 447 | #endif | 442 | #endif |
| 448 | #endif /* not IRIS */ | 443 | #endif /* not IRIS */ |
| 449 | #endif /* no PTY_OPEN */ | 444 | #endif /* no PTY_OPEN */ |
| @@ -460,7 +455,7 @@ allocate_pty () | |||
| 460 | #ifndef UNIPLUS | 455 | #ifndef UNIPLUS |
| 461 | if (access (pty_name, 6) != 0) | 456 | if (access (pty_name, 6) != 0) |
| 462 | { | 457 | { |
| 463 | close (fd); | 458 | emacs_close (fd); |
| 464 | #if !defined(IRIS) && !defined(__sgi) | 459 | #if !defined(IRIS) && !defined(__sgi) |
| 465 | continue; | 460 | continue; |
| 466 | #else | 461 | #else |
| @@ -1361,9 +1356,9 @@ create_process (process, new_argv, current_dir) | |||
| 1361 | #ifdef O_NOCTTY | 1356 | #ifdef O_NOCTTY |
| 1362 | /* Don't let this terminal become our controlling terminal | 1357 | /* Don't let this terminal become our controlling terminal |
| 1363 | (in case we don't have one). */ | 1358 | (in case we don't have one). */ |
| 1364 | forkout = forkin = open (pty_name, O_RDWR | O_NOCTTY, 0); | 1359 | forkout = forkin = emacs_open (pty_name, O_RDWR | O_NOCTTY, 0); |
| 1365 | #else | 1360 | #else |
| 1366 | forkout = forkin = open (pty_name, O_RDWR, 0); | 1361 | forkout = forkin = emacs_open (pty_name, O_RDWR, 0); |
| 1367 | #endif | 1362 | #endif |
| 1368 | if (forkin < 0) | 1363 | if (forkin < 0) |
| 1369 | report_file_error ("Opening pty", Qnil); | 1364 | report_file_error ("Opening pty", Qnil); |
| @@ -1392,8 +1387,8 @@ create_process (process, new_argv, current_dir) | |||
| 1392 | tem = pipe (sv); | 1387 | tem = pipe (sv); |
| 1393 | if (tem < 0) | 1388 | if (tem < 0) |
| 1394 | { | 1389 | { |
| 1395 | close (inchannel); | 1390 | emacs_close (inchannel); |
| 1396 | close (forkout); | 1391 | emacs_close (forkout); |
| 1397 | report_file_error ("Creating pipe", Qnil); | 1392 | report_file_error ("Creating pipe", Qnil); |
| 1398 | } | 1393 | } |
| 1399 | outchannel = sv[1]; | 1394 | outchannel = sv[1]; |
| @@ -1592,7 +1587,7 @@ create_process (process, new_argv, current_dir) | |||
| 1592 | tcgetattr (xforkin, &t); | 1587 | tcgetattr (xforkin, &t); |
| 1593 | t.c_lflag = LDISC1; | 1588 | t.c_lflag = LDISC1; |
| 1594 | if (tcsetattr (xforkin, TCSANOW, &t) < 0) | 1589 | if (tcsetattr (xforkin, TCSANOW, &t) < 0) |
| 1595 | write (1, "create_process/tcsetattr LDISC1 failed\n", 39); | 1590 | emacs_write (1, "create_process/tcsetattr LDISC1 failed\n", 39); |
| 1596 | } | 1591 | } |
| 1597 | #else | 1592 | #else |
| 1598 | #if defined (NTTYDISC) && defined (TIOCSETD) | 1593 | #if defined (NTTYDISC) && defined (TIOCSETD) |
| @@ -1611,9 +1606,9 @@ create_process (process, new_argv, current_dir) | |||
| 1611 | { | 1606 | { |
| 1612 | /* I wonder: would just ioctl (0, TIOCNOTTY, 0) work here? | 1607 | /* I wonder: would just ioctl (0, TIOCNOTTY, 0) work here? |
| 1613 | I can't test it since I don't have 4.3. */ | 1608 | I can't test it since I don't have 4.3. */ |
| 1614 | int j = open ("/dev/tty", O_RDWR, 0); | 1609 | int j = emacs_open ("/dev/tty", O_RDWR, 0); |
| 1615 | ioctl (j, TIOCNOTTY, 0); | 1610 | ioctl (j, TIOCNOTTY, 0); |
| 1616 | close (j); | 1611 | emacs_close (j); |
| 1617 | #ifndef USG | 1612 | #ifndef USG |
| 1618 | /* In order to get a controlling terminal on some versions | 1613 | /* In order to get a controlling terminal on some versions |
| 1619 | of BSD, it is necessary to put the process in pgrp 0 | 1614 | of BSD, it is necessary to put the process in pgrp 0 |
| @@ -1642,16 +1637,17 @@ create_process (process, new_argv, current_dir) | |||
| 1642 | int pgrp = getpid (); | 1637 | int pgrp = getpid (); |
| 1643 | #endif | 1638 | #endif |
| 1644 | 1639 | ||
| 1645 | /* I wonder if close (open (pty_name, ...)) would work? */ | 1640 | /* I wonder if emacs_close (emacs_open (pty_name, ...)) |
| 1641 | would work? */ | ||
| 1646 | if (xforkin >= 0) | 1642 | if (xforkin >= 0) |
| 1647 | close (xforkin); | 1643 | emacs_close (xforkin); |
| 1648 | xforkout = xforkin = open (pty_name, O_RDWR, 0); | 1644 | xforkout = xforkin = emacs_open (pty_name, O_RDWR, 0); |
| 1649 | 1645 | ||
| 1650 | if (xforkin < 0) | 1646 | if (xforkin < 0) |
| 1651 | { | 1647 | { |
| 1652 | write (1, "Couldn't open the pty terminal ", 31); | 1648 | emacs_write (1, "Couldn't open the pty terminal ", 31); |
| 1653 | write (1, pty_name, strlen (pty_name)); | 1649 | emacs_write (1, pty_name, strlen (pty_name)); |
| 1654 | write (1, "\n", 1); | 1650 | emacs_write (1, "\n", 1); |
| 1655 | _exit (1); | 1651 | _exit (1); |
| 1656 | } | 1652 | } |
| 1657 | 1653 | ||
| @@ -1717,9 +1713,9 @@ create_process (process, new_argv, current_dir) | |||
| 1717 | if (pid < 0) | 1713 | if (pid < 0) |
| 1718 | { | 1714 | { |
| 1719 | if (forkin >= 0) | 1715 | if (forkin >= 0) |
| 1720 | close (forkin); | 1716 | emacs_close (forkin); |
| 1721 | if (forkin != forkout && forkout >= 0) | 1717 | if (forkin != forkout && forkout >= 0) |
| 1722 | close (forkout); | 1718 | emacs_close (forkout); |
| 1723 | } | 1719 | } |
| 1724 | else | 1720 | else |
| 1725 | { | 1721 | { |
| @@ -1738,11 +1734,11 @@ create_process (process, new_argv, current_dir) | |||
| 1738 | alarm (1); | 1734 | alarm (1); |
| 1739 | XPROCESS (process)->subtty = Qnil; | 1735 | XPROCESS (process)->subtty = Qnil; |
| 1740 | if (forkin >= 0) | 1736 | if (forkin >= 0) |
| 1741 | close (forkin); | 1737 | emacs_close (forkin); |
| 1742 | alarm (0); | 1738 | alarm (0); |
| 1743 | start_polling (); | 1739 | start_polling (); |
| 1744 | if (forkin != forkout && forkout >= 0) | 1740 | if (forkin != forkout && forkout >= 0) |
| 1745 | close (forkout); | 1741 | emacs_close (forkout); |
| 1746 | 1742 | ||
| 1747 | #ifdef HAVE_PTYS | 1743 | #ifdef HAVE_PTYS |
| 1748 | if (pty_flag) | 1744 | if (pty_flag) |
| @@ -1926,7 +1922,7 @@ Fourth arg SERVICE is name of the service desired, or an integer\n\ | |||
| 1926 | ret = connect (s, lres->ai_addr, lres->ai_addrlen); | 1922 | ret = connect (s, lres->ai_addr, lres->ai_addrlen); |
| 1927 | if (ret == 0) | 1923 | if (ret == 0) |
| 1928 | break; | 1924 | break; |
| 1929 | close (s); | 1925 | emacs_close (s); |
| 1930 | s = -1; | 1926 | s = -1; |
| 1931 | } | 1927 | } |
| 1932 | 1928 | ||
| @@ -2033,7 +2029,7 @@ Fourth arg SERVICE is name of the service desired, or an integer\n\ | |||
| 2033 | /* Discard the unwind protect. */ | 2029 | /* Discard the unwind protect. */ |
| 2034 | specpdl_ptr = specpdl + count1; | 2030 | specpdl_ptr = specpdl + count1; |
| 2035 | 2031 | ||
| 2036 | close (s); | 2032 | emacs_close (s); |
| 2037 | 2033 | ||
| 2038 | if (interrupt_input) | 2034 | if (interrupt_input) |
| 2039 | request_sigio (); | 2035 | request_sigio (); |
| @@ -2200,9 +2196,9 @@ deactivate_process (proc) | |||
| 2200 | give_back_vms_process_stuff (vs); | 2196 | give_back_vms_process_stuff (vs); |
| 2201 | } | 2197 | } |
| 2202 | #else | 2198 | #else |
| 2203 | close (inchannel); | 2199 | emacs_close (inchannel); |
| 2204 | if (outchannel >= 0 && outchannel != inchannel) | 2200 | if (outchannel >= 0 && outchannel != inchannel) |
| 2205 | close (outchannel); | 2201 | emacs_close (outchannel); |
| 2206 | #endif | 2202 | #endif |
| 2207 | 2203 | ||
| 2208 | XSETINT (p->infd, -1); | 2204 | XSETINT (p->infd, -1); |
| @@ -2241,9 +2237,9 @@ close_process_descs () | |||
| 2241 | int in = XINT (XPROCESS (process)->infd); | 2237 | int in = XINT (XPROCESS (process)->infd); |
| 2242 | int out = XINT (XPROCESS (process)->outfd); | 2238 | int out = XINT (XPROCESS (process)->outfd); |
| 2243 | if (in >= 0) | 2239 | if (in >= 0) |
| 2244 | close (in); | 2240 | emacs_close (in); |
| 2245 | if (out >= 0 && in != out) | 2241 | if (out >= 0 && in != out) |
| 2246 | close (out); | 2242 | emacs_close (out); |
| 2247 | } | 2243 | } |
| 2248 | } | 2244 | } |
| 2249 | #endif | 2245 | #endif |
| @@ -2651,7 +2647,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 2651 | #endif | 2647 | #endif |
| 2652 | } | 2648 | } |
| 2653 | else | 2649 | else |
| 2654 | error ("select error: %s", strerror (xerrno)); | 2650 | error ("select error: %s", emacs_strerror (xerrno)); |
| 2655 | } | 2651 | } |
| 2656 | #if defined(sun) && !defined(USG5_4) | 2652 | #if defined(sun) && !defined(USG5_4) |
| 2657 | else if (nfds > 0 && keyboard_bit_set (&Available) | 2653 | else if (nfds > 0 && keyboard_bit_set (&Available) |
| @@ -2955,13 +2951,13 @@ read_process_output (proc, channel) | |||
| 2955 | buf, carryover); | 2951 | buf, carryover); |
| 2956 | 2952 | ||
| 2957 | if (proc_buffered_char[channel] < 0) | 2953 | if (proc_buffered_char[channel] < 0) |
| 2958 | nbytes = read (channel, buf + carryover, (sizeof buf) - carryover); | 2954 | nbytes = emacs_read (channel, buf + carryover, (sizeof buf) - carryover); |
| 2959 | else | 2955 | else |
| 2960 | { | 2956 | { |
| 2961 | buf[carryover] = proc_buffered_char[channel]; | 2957 | buf[carryover] = proc_buffered_char[channel]; |
| 2962 | proc_buffered_char[channel] = -1; | 2958 | proc_buffered_char[channel] = -1; |
| 2963 | nbytes = read (channel, buf + carryover + 1, | 2959 | nbytes = emacs_read (channel, buf + carryover + 1, |
| 2964 | (sizeof buf) - carryover - 1); | 2960 | (sizeof buf) - carryover - 1); |
| 2965 | if (nbytes < 0) | 2961 | if (nbytes < 0) |
| 2966 | nbytes = 1; | 2962 | nbytes = 1; |
| 2967 | else | 2963 | else |
| @@ -3452,7 +3448,7 @@ send_process (proc, buf, len, object) | |||
| 3452 | while (this > 0) | 3448 | while (this > 0) |
| 3453 | { | 3449 | { |
| 3454 | old_sigpipe = (SIGTYPE (*) ()) signal (SIGPIPE, send_process_trap); | 3450 | old_sigpipe = (SIGTYPE (*) ()) signal (SIGPIPE, send_process_trap); |
| 3455 | rv = write (XINT (XPROCESS (proc)->outfd), buf, this); | 3451 | rv = emacs_write (XINT (XPROCESS (proc)->outfd), buf, this); |
| 3456 | signal (SIGPIPE, old_sigpipe); | 3452 | signal (SIGPIPE, old_sigpipe); |
| 3457 | 3453 | ||
| 3458 | if (rv < 0) | 3454 | if (rv < 0) |
| @@ -4073,11 +4069,11 @@ text to PROCESS after you call this function.") | |||
| 4073 | shutdown (XINT (XPROCESS (proc)->outfd), 1); | 4069 | shutdown (XINT (XPROCESS (proc)->outfd), 1); |
| 4074 | /* In case of socketpair, outfd == infd, so don't close it. */ | 4070 | /* In case of socketpair, outfd == infd, so don't close it. */ |
| 4075 | if (XINT (XPROCESS (proc)->outfd) != XINT (XPROCESS (proc)->infd)) | 4071 | if (XINT (XPROCESS (proc)->outfd) != XINT (XPROCESS (proc)->infd)) |
| 4076 | close (XINT (XPROCESS (proc)->outfd)); | 4072 | emacs_close (XINT (XPROCESS (proc)->outfd)); |
| 4077 | #else /* not HAVE_SHUTDOWN */ | 4073 | #else /* not HAVE_SHUTDOWN */ |
| 4078 | close (XINT (XPROCESS (proc)->outfd)); | 4074 | emacs_close (XINT (XPROCESS (proc)->outfd)); |
| 4079 | #endif /* not HAVE_SHUTDOWN */ | 4075 | #endif /* not HAVE_SHUTDOWN */ |
| 4080 | new_outfd = open (NULL_DEVICE, O_WRONLY); | 4076 | new_outfd = emacs_open (NULL_DEVICE, O_WRONLY, 0); |
| 4081 | old_outfd = XINT (XPROCESS (proc)->outfd); | 4077 | old_outfd = XINT (XPROCESS (proc)->outfd); |
| 4082 | 4078 | ||
| 4083 | if (!proc_encode_coding_system[new_outfd]) | 4079 | if (!proc_encode_coding_system[new_outfd]) |
| @@ -4256,17 +4252,11 @@ sigchld_handler (signo) | |||
| 4256 | else if (WIFSIGNALED (w)) | 4252 | else if (WIFSIGNALED (w)) |
| 4257 | { | 4253 | { |
| 4258 | int code = WTERMSIG (w); | 4254 | int code = WTERMSIG (w); |
| 4259 | char *signame = 0; | 4255 | char *signame; |
| 4256 | |||
| 4257 | synchronize_messages_locale (); | ||
| 4258 | signame = strsignal (code); | ||
| 4260 | 4259 | ||
| 4261 | if (code < NSIG) | ||
| 4262 | { | ||
| 4263 | #ifndef VMS | ||
| 4264 | /* Suppress warning if the table has const char *. */ | ||
| 4265 | signame = (char *) sys_siglist[code]; | ||
| 4266 | #else | ||
| 4267 | signame = sys_errlist[code]; | ||
| 4268 | #endif | ||
| 4269 | } | ||
| 4270 | if (signame == 0) | 4260 | if (signame == 0) |
| 4271 | signame = "unknown"; | 4261 | signame = "unknown"; |
| 4272 | 4262 | ||
| @@ -4923,7 +4913,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4923 | if (xerrno == EINTR) | 4913 | if (xerrno == EINTR) |
| 4924 | FD_ZERO (&waitchannels); | 4914 | FD_ZERO (&waitchannels); |
| 4925 | else | 4915 | else |
| 4926 | error ("select error: %s", strerror (xerrno)); | 4916 | error ("select error: %s", emacs_strerror (xerrno)); |
| 4927 | } | 4917 | } |
| 4928 | #ifdef sun | 4918 | #ifdef sun |
| 4929 | else if (nfds > 0 && (waitchannels & 1) && interrupt_input) | 4919 | else if (nfds > 0 && (waitchannels & 1) && interrupt_input) |