From: Pavel Janík Date: Mon, 18 Mar 2002 18:22:37 +0000 (+0000) Subject: (wait_reading_process_input): Move variables `pname' and `pnamelen' down X-Git-Tag: ttn-vms-21-2-B4~16089 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=44c887be5c7dc710469e0d00d235a9270945baad;p=emacs.git (wait_reading_process_input): Move variables `pname' and `pnamelen' down where they are used. --- diff --git a/src/ChangeLog b/src/ChangeLog index 304c76f687e..a4f16623cf5 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 8c4de90638c..8045ffa4067 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) {