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/sysdep.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/sysdep.c')
| -rw-r--r-- | src/sysdep.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index 82f490e9538..465d271abca 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -2436,14 +2436,11 @@ safe_strsignal (int code) | |||
| 2436 | #ifndef DOS_NT | 2436 | #ifndef DOS_NT |
| 2437 | /* For make-serial-process */ | 2437 | /* For make-serial-process */ |
| 2438 | int | 2438 | int |
| 2439 | serial_open (char *port) | 2439 | serial_open (Lisp_Object port) |
| 2440 | { | 2440 | { |
| 2441 | int fd = emacs_open (port, O_RDWR | O_NOCTTY | O_NONBLOCK, 0); | 2441 | int fd = emacs_open (SSDATA (port), O_RDWR | O_NOCTTY | O_NONBLOCK, 0); |
| 2442 | if (fd < 0) | 2442 | if (fd < 0) |
| 2443 | { | 2443 | report_file_error ("Opening serial port", port); |
| 2444 | error ("Could not open %s: %s", | ||
| 2445 | port, emacs_strerror (errno)); | ||
| 2446 | } | ||
| 2447 | #ifdef TIOCEXCL | 2444 | #ifdef TIOCEXCL |
| 2448 | ioctl (fd, TIOCEXCL, (char *) 0); | 2445 | ioctl (fd, TIOCEXCL, (char *) 0); |
| 2449 | #endif | 2446 | #endif |
| @@ -2491,7 +2488,7 @@ serial_configure (struct Lisp_Process *p, | |||
| 2491 | /* Read port attributes and prepare default configuration. */ | 2488 | /* Read port attributes and prepare default configuration. */ |
| 2492 | err = tcgetattr (p->outfd, &attr); | 2489 | err = tcgetattr (p->outfd, &attr); |
| 2493 | if (err != 0) | 2490 | if (err != 0) |
| 2494 | error ("tcgetattr() failed: %s", emacs_strerror (errno)); | 2491 | report_file_error ("Failed tcgetattr", Qnil); |
| 2495 | cfmakeraw (&attr); | 2492 | cfmakeraw (&attr); |
| 2496 | #if defined (CLOCAL) | 2493 | #if defined (CLOCAL) |
| 2497 | attr.c_cflag |= CLOCAL; | 2494 | attr.c_cflag |= CLOCAL; |
| @@ -2508,8 +2505,7 @@ serial_configure (struct Lisp_Process *p, | |||
| 2508 | CHECK_NUMBER (tem); | 2505 | CHECK_NUMBER (tem); |
| 2509 | err = cfsetspeed (&attr, XINT (tem)); | 2506 | err = cfsetspeed (&attr, XINT (tem)); |
| 2510 | if (err != 0) | 2507 | if (err != 0) |
| 2511 | error ("cfsetspeed(%"pI"d) failed: %s", XINT (tem), | 2508 | report_file_error ("Failed cfsetspeed", tem); |
| 2512 | emacs_strerror (errno)); | ||
| 2513 | childp2 = Fplist_put (childp2, QCspeed, tem); | 2509 | childp2 = Fplist_put (childp2, QCspeed, tem); |
| 2514 | 2510 | ||
| 2515 | /* Configure bytesize. */ | 2511 | /* Configure bytesize. */ |
| @@ -2631,7 +2627,7 @@ serial_configure (struct Lisp_Process *p, | |||
| 2631 | /* Activate configuration. */ | 2627 | /* Activate configuration. */ |
| 2632 | err = tcsetattr (p->outfd, TCSANOW, &attr); | 2628 | err = tcsetattr (p->outfd, TCSANOW, &attr); |
| 2633 | if (err != 0) | 2629 | if (err != 0) |
| 2634 | error ("tcsetattr() failed: %s", emacs_strerror (errno)); | 2630 | report_file_error ("Failed tcsetattr", Qnil); |
| 2635 | 2631 | ||
| 2636 | childp2 = Fplist_put (childp2, QCsummary, build_string (summary)); | 2632 | childp2 = Fplist_put (childp2, QCsummary, build_string (summary)); |
| 2637 | pset_childp (p, childp2); | 2633 | pset_childp (p, childp2); |