duplicated lines in serverloop.c? (openssh252p2)

Sandor W. Sklar ssklar at stanford.edu
Tue Mar 27 06:45:01 EST 2001


ok, I'm a moron.  I overlooked that little "fdout/fderr" difference.

duh.

Thanks,
--Sandy

At 12:37 PM -0800 3/26/01, Dennis Haag wrote:
>"Sandor W. Sklar" wrote:
>>
>>  Hi,
>>
>>  I was looking through the source, and I noticed that the following
>>  code appears twice in the file serverloop.c.  Is it supposed to, and
>>  if not, would there be any ill effect?
>>
>>     +289
>>     +290          /* Read and buffer any available stdout data from the
>>  program. */
>>     +291          if (!fdout_eof && FD_ISSET(fdout, readset)) {
>>     +292                  len = read(fdout, buf, sizeof(buf));
>>     +293                  if (len < 0 && (errno == EINTR || errno 
>>== EAGAIN)) {
>>     +294                          /* do nothing */
>>     +295                  } else if (len <= 0) {
>>     +296                          fdout_eof = 1;
>>     +297                  } else {
>>     +298                          buffer_append(&stdout_buffer, buf, len);
>>     +299                          fdout_bytes += len;
>>     +300                  }
>>     +301          }
>>     +302          /* Read and buffer any available stderr data from the
>>  program. */
>>     +303          if (!fderr_eof && FD_ISSET(fderr, readset)) {
>>     +304                  len = read(fderr, buf, sizeof(buf));
>>     +305                  if (len < 0 && (errno == EINTR || errno 
>>== EAGAIN)) {
>>     +306                          /* do nothing */
>>     +307                  } else if (len <= 0) {
>>     +308                          fderr_eof = 1;
>>     +309                  } else {
>>     +310                          buffer_append(&stderr_buffer, buf, len);
>>     +311                  }
>>     +312          }
>>
>>  --
>>  sandor w. sklar
>>  unix systems administrator
>>  stanford university itss-css
>
>Once for STDOUT (fdout) and once for STDERR (fderr).
>
>--
>Dennis Haag                             Engineering Computer Services
>haag at apple.com                          unix-support at apple.com
>408-974-6630                            ECS Hotline: 408-974-4747

-- 
sandor w. sklar
unix systems administrator
stanford university itss-css




More information about the openssh-unix-dev mailing list