diff options
| author | Richard M. Stallman | 1993-12-24 03:49:30 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-12-24 03:49:30 +0000 |
| commit | 457a9beedefeab952ad28f9705ffb21ce5b77479 (patch) | |
| tree | ce64eea44f767e22a031242ff7decbeee214208f /src | |
| parent | 913126a6bce839632ff1a92fd2f09afaa1c4fcea (diff) | |
| download | emacs-457a9beedefeab952ad28f9705ffb21ce5b77479.tar.gz emacs-457a9beedefeab952ad28f9705ffb21ce5b77479.zip | |
(Fopen_network_stream): Turn off SIGIO while connecting.
Diffstat (limited to 'src')
| -rw-r--r-- | src/process.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/process.c b/src/process.c index 5d798786171..107bc05d28a 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -1446,6 +1446,15 @@ Fourth arg SERVICE is name of the service desired, or an integer\n\ | |||
| 1446 | if (s < 0) | 1446 | if (s < 0) |
| 1447 | report_file_error ("error creating socket", Fcons (name, Qnil)); | 1447 | report_file_error ("error creating socket", Fcons (name, Qnil)); |
| 1448 | 1448 | ||
| 1449 | /* Kernel bugs (on Ultrix at least) cause lossage (not just EINTR) | ||
| 1450 | when connect is interrupted. So let's not let it get interrupted. | ||
| 1451 | Note we do not turn off polling, because polling is only used | ||
| 1452 | when not interrupt_input, and thus not normally used on the systems | ||
| 1453 | which have this bug. On systems which use polling, there's no way | ||
| 1454 | to quit if polling is turned off. */ | ||
| 1455 | if (interrupt_input) | ||
| 1456 | unrequest_sigio (); | ||
| 1457 | |||
| 1449 | loop: | 1458 | loop: |
| 1450 | if (connect (s, (struct sockaddr *) &address, sizeof address) == -1) | 1459 | if (connect (s, (struct sockaddr *) &address, sizeof address) == -1) |
| 1451 | { | 1460 | { |
| @@ -1453,10 +1462,18 @@ Fourth arg SERVICE is name of the service desired, or an integer\n\ | |||
| 1453 | if (errno == EINTR) | 1462 | if (errno == EINTR) |
| 1454 | goto loop; | 1463 | goto loop; |
| 1455 | close (s); | 1464 | close (s); |
| 1465 | |||
| 1466 | if (interrupt_input) | ||
| 1467 | request_sigio (); | ||
| 1468 | |||
| 1456 | errno = xerrno; | 1469 | errno = xerrno; |
| 1457 | report_file_error ("connection failed", | 1470 | report_file_error ("connection failed", |
| 1458 | Fcons (host, Fcons (name, Qnil))); | 1471 | Fcons (host, Fcons (name, Qnil))); |
| 1459 | } | 1472 | } |
| 1473 | |||
| 1474 | if (interrupt_input) | ||
| 1475 | request_sigio (); | ||
| 1476 | |||
| 1460 | #else /* TERM */ | 1477 | #else /* TERM */ |
| 1461 | s = connect_server (0); | 1478 | s = connect_server (0); |
| 1462 | if (s < 0) | 1479 | if (s < 0) |