From 44c887be5c7dc710469e0d00d235a9270945baad Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pavel=20Jan=C3=ADk?= Date: Mon, 18 Mar 2002 18:22:37 +0000 Subject: [PATCH] (wait_reading_process_input): Move variables `pname' and `pnamelen' down where they are used. --- src/ChangeLog | 3 +++ src/process.c | 25 ++++++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 304c76f687..a4f16623cf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2002-03-18 Pavel Jan,Bm(Bk + * process.c (wait_reading_process_input): Move variables `pname' + and `pnamelen' down where they are used. + * bytecode.c (Fbyte_code): Discard unused computed value to prevent gcc warning. 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) { -- 2.20.1