diff options
| author | Paul Eggert | 2013-07-16 11:30:52 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-07-16 11:30:52 -0700 |
| commit | 4e604a5d70c4f26abe8bb3494346c598389906b3 (patch) | |
| tree | 6842a74fd23245cde0e5e4a97aa42ca32c119a0f /src/process.c | |
| parent | a9757f6a03cce5ff2931b1125a9a2249573c8e1c (diff) | |
| download | emacs-4e604a5d70c4f26abe8bb3494346c598389906b3.tar.gz emacs-4e604a5d70c4f26abe8bb3494346c598389906b3.zip | |
Be simpler and more consistent about reporting I/O errors.
* fileio.c (Fcopy_file, Finsert_file_contents, Fwrite_region):
Say "Read error" and "Write error", rather than "I/O error", or
"IO error reading", or "IO error writing", when a read or write
error occurs.
* process.c (Fmake_network_process, wait_reading_process_output)
(send_process, Fprocess_send_eof, wait_reading_process_output):
Capitalize diagnostics consistently. Put "failed foo" at the
start of the diagnostic, so that we don't capitalize the
function name "foo". Consistently say "failed" for such
diagnostics.
* sysdep.c, w32.c (serial_open): Now accepts Lisp string, not C string.
All callers changed. This is so it can use report_file_error.
* sysdep.c (serial_open, serial_configure): Capitalize I/O
diagnostics consistently as above.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/process.c b/src/process.c index b51e3bab033..fe843ca2d93 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -2573,7 +2573,7 @@ usage: (make-serial-process &rest ARGS) */) | |||
| 2573 | record_unwind_protect (make_serial_process_unwind, proc); | 2573 | record_unwind_protect (make_serial_process_unwind, proc); |
| 2574 | p = XPROCESS (proc); | 2574 | p = XPROCESS (proc); |
| 2575 | 2575 | ||
| 2576 | fd = serial_open (SSDATA (port)); | 2576 | fd = serial_open (port); |
| 2577 | p->infd = fd; | 2577 | p->infd = fd; |
| 2578 | p->outfd = fd; | 2578 | p->outfd = fd; |
| 2579 | if (fd > max_process_desc) | 2579 | if (fd > max_process_desc) |
| @@ -3257,16 +3257,16 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3257 | if (errno == EINTR) | 3257 | if (errno == EINTR) |
| 3258 | goto retry_select; | 3258 | goto retry_select; |
| 3259 | else | 3259 | else |
| 3260 | report_file_error ("select failed", Qnil); | 3260 | report_file_error ("Failed select", Qnil); |
| 3261 | } | 3261 | } |
| 3262 | eassert (sc > 0); | 3262 | eassert (sc > 0); |
| 3263 | 3263 | ||
| 3264 | len = sizeof xerrno; | 3264 | len = sizeof xerrno; |
| 3265 | eassert (FD_ISSET (s, &fdset)); | 3265 | eassert (FD_ISSET (s, &fdset)); |
| 3266 | if (getsockopt (s, SOL_SOCKET, SO_ERROR, &xerrno, &len) < 0) | 3266 | if (getsockopt (s, SOL_SOCKET, SO_ERROR, &xerrno, &len) < 0) |
| 3267 | report_file_error ("getsockopt failed", Qnil); | 3267 | report_file_error ("Failed getsockopt", Qnil); |
| 3268 | if (xerrno) | 3268 | if (xerrno) |
| 3269 | report_file_errno ("error during connect", Qnil, xerrno); | 3269 | report_file_errno ("Failed connect", Qnil, xerrno); |
| 3270 | break; | 3270 | break; |
| 3271 | } | 3271 | } |
| 3272 | #endif /* !WINDOWSNT */ | 3272 | #endif /* !WINDOWSNT */ |
| @@ -4624,7 +4624,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 4624 | else if (xerrno == EBADF) | 4624 | else if (xerrno == EBADF) |
| 4625 | emacs_abort (); | 4625 | emacs_abort (); |
| 4626 | else | 4626 | else |
| 4627 | error ("select error: %s", emacs_strerror (xerrno)); | 4627 | report_file_errno ("Failed select", Qnil, xerrno); |
| 4628 | } | 4628 | } |
| 4629 | 4629 | ||
| 4630 | if (no_avail) | 4630 | if (no_avail) |
| @@ -5466,7 +5466,7 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len, | |||
| 5466 | if (rv >= 0) | 5466 | if (rv >= 0) |
| 5467 | written = rv; | 5467 | written = rv; |
| 5468 | else if (errno == EMSGSIZE) | 5468 | else if (errno == EMSGSIZE) |
| 5469 | report_file_error ("sending datagram", proc); | 5469 | report_file_error ("Sending datagram", proc); |
| 5470 | } | 5470 | } |
| 5471 | else | 5471 | else |
| 5472 | #endif | 5472 | #endif |
| @@ -5543,7 +5543,7 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len, | |||
| 5543 | } | 5543 | } |
| 5544 | else | 5544 | else |
| 5545 | /* This is a real error. */ | 5545 | /* This is a real error. */ |
| 5546 | report_file_error ("writing to process", proc); | 5546 | report_file_error ("Writing to process", proc); |
| 5547 | } | 5547 | } |
| 5548 | cur_buf += written; | 5548 | cur_buf += written; |
| 5549 | cur_len -= written; | 5549 | cur_len -= written; |
| @@ -6037,7 +6037,7 @@ process has been transmitted to the serial port. */) | |||
| 6037 | { | 6037 | { |
| 6038 | #ifndef WINDOWSNT | 6038 | #ifndef WINDOWSNT |
| 6039 | if (tcdrain (XPROCESS (proc)->outfd) != 0) | 6039 | if (tcdrain (XPROCESS (proc)->outfd) != 0) |
| 6040 | error ("tcdrain() failed: %s", emacs_strerror (errno)); | 6040 | report_file_error ("Failed tcdrain", Qnil); |
| 6041 | #endif /* not WINDOWSNT */ | 6041 | #endif /* not WINDOWSNT */ |
| 6042 | /* Do nothing on Windows because writes are blocking. */ | 6042 | /* Do nothing on Windows because writes are blocking. */ |
| 6043 | } | 6043 | } |
| @@ -6733,7 +6733,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 6733 | if (xerrno == EINTR) | 6733 | if (xerrno == EINTR) |
| 6734 | FD_ZERO (&waitchannels); | 6734 | FD_ZERO (&waitchannels); |
| 6735 | else | 6735 | else |
| 6736 | error ("select error: %s", emacs_strerror (xerrno)); | 6736 | report_file_errno ("Failed select", Qnil, xerrno); |
| 6737 | } | 6737 | } |
| 6738 | 6738 | ||
| 6739 | /* Check for keyboard input */ | 6739 | /* Check for keyboard input */ |