diff options
| author | Lars Ingebrigtsen | 2018-07-22 13:39:10 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2018-07-22 13:39:10 +0200 |
| commit | 92ba34d89ac4f5b5bbb818e1c39a3cc12a405790 (patch) | |
| tree | 0f3234e5ad986089c061a9402663b8533647db82 /src/process.c | |
| parent | e23727978dbb07d68f730ffa60b22d59d065850e (diff) | |
| download | emacs-92ba34d89ac4f5b5bbb818e1c39a3cc12a405790.tar.gz emacs-92ba34d89ac4f5b5bbb818e1c39a3cc12a405790.zip | |
Make async :family 'local failures fail correctly again
* src/fileio.c (get_file_errno_data): Refactor out into its own
function so that we can reuse the error handling from an async
context (bug#31901).
* src/process.c (connect_network_socket): When an async :family
'local client fails (with a file error, for instance), mark the
process as failed.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/process.c b/src/process.c index 06324641346..aafb46c3615 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -3587,17 +3587,23 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos, | |||
| 3587 | 3587 | ||
| 3588 | if (s < 0) | 3588 | if (s < 0) |
| 3589 | { | 3589 | { |
| 3590 | const char *err = (p->is_server | ||
| 3591 | ? "make server process failed" | ||
| 3592 | : "make client process failed"); | ||
| 3593 | |||
| 3590 | /* If non-blocking got this far - and failed - assume non-blocking is | 3594 | /* If non-blocking got this far - and failed - assume non-blocking is |
| 3591 | not supported after all. This is probably a wrong assumption, but | 3595 | not supported after all. This is probably a wrong assumption, but |
| 3592 | the normal blocking calls to open-network-stream handles this error | 3596 | the normal blocking calls to open-network-stream handles this error |
| 3593 | better. */ | 3597 | better. */ |
| 3594 | if (p->is_non_blocking_client) | 3598 | if (p->is_non_blocking_client) |
| 3595 | return; | 3599 | { |
| 3600 | Lisp_Object data = get_file_errno_data (err, contact, xerrno); | ||
| 3601 | |||
| 3602 | pset_status (p, list2 (Fcar (data), Fcdr (data))); | ||
| 3603 | return; | ||
| 3604 | } | ||
| 3596 | 3605 | ||
| 3597 | report_file_errno ((p->is_server | 3606 | report_file_errno (err, contact, xerrno); |
| 3598 | ? "make server process failed" | ||
| 3599 | : "make client process failed"), | ||
| 3600 | contact, xerrno); | ||
| 3601 | } | 3607 | } |
| 3602 | 3608 | ||
| 3603 | inch = s; | 3609 | inch = s; |