diff options
| author | Chong Yidong | 2010-03-26 20:45:32 -0400 |
|---|---|---|
| committer | Chong Yidong | 2010-03-26 20:45:32 -0400 |
| commit | 649dbf36cdf3ce38a3fc0d08a814d299e9f72d8c (patch) | |
| tree | ab088682b481ac3268b8f2fd1260a54c4069d6a9 /src/process.c | |
| parent | cad4261fd31b3dec552ffc4dfd66c0b2a19169ce (diff) | |
| download | emacs-649dbf36cdf3ce38a3fc0d08a814d299e9f72d8c.tar.gz emacs-649dbf36cdf3ce38a3fc0d08a814d299e9f72d8c.zip | |
* process.c (Fmake_network_process): Don't apply Bug#5173 fix for Windows.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/src/process.c b/src/process.c index 268a3ad7bab..4f103752296 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -3534,6 +3534,8 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3534 | { | 3534 | { |
| 3535 | int optn, optbits; | 3535 | int optn, optbits; |
| 3536 | 3536 | ||
| 3537 | retry_connect: | ||
| 3538 | |||
| 3537 | s = socket (lres->ai_family, lres->ai_socktype, lres->ai_protocol); | 3539 | s = socket (lres->ai_family, lres->ai_socktype, lres->ai_protocol); |
| 3538 | if (s < 0) | 3540 | if (s < 0) |
| 3539 | { | 3541 | { |
| @@ -3636,12 +3638,14 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3636 | #endif | 3638 | #endif |
| 3637 | #endif | 3639 | #endif |
| 3638 | #endif | 3640 | #endif |
| 3641 | |||
| 3642 | #ifndef WINDOWSNT | ||
| 3639 | if (xerrno == EINTR) | 3643 | if (xerrno == EINTR) |
| 3640 | { | 3644 | { |
| 3641 | /* Unlike most other syscalls connect() cannot be called | 3645 | /* Unlike most other syscalls connect() cannot be called |
| 3642 | again. (That would return EALREADY.) The proper way to | 3646 | again. (That would return EALREADY.) The proper way to |
| 3643 | wait for completion is select(). */ | 3647 | wait for completion is select(). */ |
| 3644 | int sc; | 3648 | int sc, len; |
| 3645 | SELECT_TYPE fdset; | 3649 | SELECT_TYPE fdset; |
| 3646 | retry_select: | 3650 | retry_select: |
| 3647 | FD_ZERO (&fdset); | 3651 | FD_ZERO (&fdset); |
| @@ -3651,23 +3655,23 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3651 | (EMACS_TIME *)0); | 3655 | (EMACS_TIME *)0); |
| 3652 | if (sc == -1) | 3656 | if (sc == -1) |
| 3653 | { | 3657 | { |
| 3654 | if (errno == EINTR) | 3658 | if (errno == EINTR) |
| 3655 | goto retry_select; | 3659 | goto retry_select; |
| 3656 | else | 3660 | else |
| 3657 | report_file_error ("select failed", Qnil); | 3661 | report_file_error ("select failed", Qnil); |
| 3658 | } | 3662 | } |
| 3659 | eassert (sc > 0); | 3663 | eassert (sc > 0); |
| 3660 | { | 3664 | |
| 3661 | int len = sizeof xerrno; | 3665 | len = sizeof xerrno; |
| 3662 | eassert (FD_ISSET (s, &fdset)); | 3666 | eassert (FD_ISSET (s, &fdset)); |
| 3663 | if (getsockopt (s, SOL_SOCKET, SO_ERROR, &xerrno, &len) == -1) | 3667 | if (getsockopt (s, SOL_SOCKET, SO_ERROR, &xerrno, &len) == -1) |
| 3664 | report_file_error ("getsockopt failed", Qnil); | 3668 | report_file_error ("getsockopt failed", Qnil); |
| 3665 | if (xerrno != 0) | 3669 | if (xerrno) |
| 3666 | errno = xerrno, report_file_error ("error during connect", Qnil); | 3670 | errno = xerrno, report_file_error ("error during connect", Qnil); |
| 3667 | else | 3671 | else |
| 3668 | break; | 3672 | break; |
| 3669 | } | ||
| 3670 | } | 3673 | } |
| 3674 | #endif /* !WINDOWSNT */ | ||
| 3671 | 3675 | ||
| 3672 | immediate_quit = 0; | 3676 | immediate_quit = 0; |
| 3673 | 3677 | ||
| @@ -3675,6 +3679,11 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3675 | specpdl_ptr = specpdl + count1; | 3679 | specpdl_ptr = specpdl + count1; |
| 3676 | emacs_close (s); | 3680 | emacs_close (s); |
| 3677 | s = -1; | 3681 | s = -1; |
| 3682 | |||
| 3683 | #ifdef WINDOWSNT | ||
| 3684 | if (xerrno == EINTR) | ||
| 3685 | goto retry_connect; | ||
| 3686 | #endif | ||
| 3678 | } | 3687 | } |
| 3679 | 3688 | ||
| 3680 | if (s >= 0) | 3689 | if (s >= 0) |