Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
c2e124a9
Commit
c2e124a9
authored
Nov 04, 2010
by
Helmut Eller
Committed by
Chong Yidong
Nov 04, 2010
Browse files
Backport 2010-03-25T08:48:52Z!mituharu@math.s.chiba-u.ac.jp from trunk
parent
68ae6cda
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
5 deletions
+37
-5
src/ChangeLog
src/ChangeLog
+5
-0
src/process.c
src/process.c
+32
-5
No files found.
src/ChangeLog
View file @
c2e124a9
2010-03-25 Helmut Eller <eller.helmut@gmail.com>
* process.c (Fmake_network_process): Call `select' for interrupted
`connect' rather than creating new socket (Bug#5173).
2010-11-04 Kenichi Handa <handa@m17n.org>
2010-11-04 Kenichi Handa <handa@m17n.org>
* font.c (font_delete_unmatched): Check Vface_ignored_fonts.
* font.c (font_delete_unmatched): Check Vface_ignored_fonts.
...
...
src/process.c
View file @
c2e124a9
...
@@ -3573,8 +3573,6 @@ usage: (make-network-process &rest ARGS) */)
...
@@ -3573,8 +3573,6 @@ usage: (make-network-process &rest ARGS) */)
{
{
int optn, optbits;
int optn, optbits;
retry_connect:
s = socket (lres->ai_family, lres->ai_socktype, lres->ai_protocol);
s = socket (lres->ai_family, lres->ai_socktype, lres->ai_protocol);
if (s < 0)
if (s < 0)
{
{
...
@@ -3691,6 +3689,38 @@ usage: (make-network-process &rest ARGS) */)
...
@@ -3691,6 +3689,38 @@ usage: (make-network-process &rest ARGS) */)
#endif
#endif
#endif
#endif
#endif
#endif
if (xerrno == EINTR)
{
/* Unlike most other syscalls connect() cannot be called
again. (That would return EALREADY.) The proper way to
wait for completion is select(). */
int sc;
SELECT_TYPE fdset;
retry_select:
FD_ZERO (&fdset);
FD_SET (s, &fdset);
QUIT;
sc = select (s + 1, (SELECT_TYPE *)0, &fdset, (SELECT_TYPE *)0,
(EMACS_TIME *)0);
if (sc == -1)
{
if (errno == EINTR)
goto retry_select;
else
report_file_error ("select failed", Qnil);
}
eassert (sc > 0);
{
int len = sizeof xerrno;
eassert (FD_ISSET (s, &fdset));
if (getsockopt (s, SOL_SOCKET, SO_ERROR, &xerrno, &len) == -1)
report_file_error ("getsockopt failed", Qnil);
if (xerrno != 0)
errno = xerrno, report_file_error ("error during connect", Qnil);
else
break;
}
}
immediate_quit = 0;
immediate_quit = 0;
...
@@ -3698,9 +3728,6 @@ usage: (make-network-process &rest ARGS) */)
...
@@ -3698,9 +3728,6 @@ usage: (make-network-process &rest ARGS) */)
specpdl_ptr = specpdl + count1;
specpdl_ptr = specpdl + count1;
emacs_close (s);
emacs_close (s);
s = -1;
s = -1;
if (xerrno == EINTR)
goto retry_connect;
}
}
if (s >= 0)
if (s >= 0)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment