diff options
author | Pavel Janík <[email protected]> | 2002-03-18 18:22:37 +0000 |
---|---|---|
committer | Pavel Janík <[email protected]> | 2002-03-18 18:22:37 +0000 |
commit | 44c887be5c7dc710469e0d00d235a9270945baad (patch) | |
tree | 6bf922171fc2b543b972d945ff990902a912f599 /src/process.c | |
parent | 18f85cdd59204ec4f636cba3122e83c76b462dee (diff) |
(wait_reading_process_input): Move variables `pname' and `pnamelen' down
where they are used.
Diffstat (limited to 'src/process.c')
-rw-r--r-- | src/process.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/process.c b/src/process.c index 8c4de90638..8045ffa406 100644 --- a/src/process.c +++ b/src/process.c @@ -4207,8 +4207,6 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) if (check_connect && FD_ISSET (channel, &Connecting)) { struct Lisp_Process *p; - struct sockaddr pname; - int pnamelen = sizeof(pname); FD_CLR (channel, &connect_wait_mask); if (--num_pending_connects < 0) @@ -4229,16 +4227,21 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) xerrno = errno; } #else - /* If connection failed, getpeername will fail. */ - xerrno = 0; - if (getpeername(channel, &pname, &pnamelen) < 0) - { - /* Obtain connect failure code through error slippage. */ - char dummy; - xerrno = errno; - if (errno == ENOTCONN && read(channel, &dummy, 1) < 0) + { + struct sockaddr pname; + int pnamelen = sizeof(pname); + + /* If connection failed, getpeername will fail. */ + xerrno = 0; + if (getpeername(channel, &pname, &pnamelen) < 0) + { + /* Obtain connect failure code through error slippage. */ + char dummy; xerrno = errno; - } + if (errno == ENOTCONN && read(channel, &dummy, 1) < 0) + xerrno = errno; + } + } #endif if (xerrno) { |