[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bad interaction between CVS and ssh due to libc

From: Derek Robert Price
Subject: Re: Bad interaction between CVS and ssh due to libc
Date: Mon, 12 Aug 2002 09:51:10 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020606

Paul Eggert wrote:

From: prj@po.cwru.edu (Paul Jarc)
Date: Fri, 09 Aug 2002 14:25:20 -0400

Derek Robert Price <derek@ximbiot.com> wrote:
I assume they have different file table entries in the kernel
because stderr can be set to nonblock without doing the same to
stdout.  I need to know when the two file descriptors point to the
same file table entry (i.e. $ cvs <whatever> 2>&1).
Ah.  So frob the flags on one of them and see if the other one changes
too; then restore the original flags.  This still isn't perfect, for
the same reason that the problem exists: another process with a copy
of the same descriptor could be messing around with flags at the same
time.  But that seems unlikely in the cases where the problem appears.

Since (as you mention) this optimization isn't safe, then I wouldn't
do it.  For this particular application, it's just an optimization to
check for the same file table entries; it's OK to omit the
optimization if it isn't safe.

In contrast, the st_dev+st_ino optimization is safe, since it doesn't
make any assumptions about what other processes are doing.

st_dev+st_ino isn't much of an optimization. The only time creating the extra process is going to be avoided is when half the CVS output has been redirected (or both stdout and stderr to different locations). I would guess that unredirected output and is the most common of the possible cases and thus installing the optimization is somewhat pointless.



Email: derek@ximbiot.com

Get CVS support at http://ximbiot.com
I will not skateboard in the halls.
I will not skateboard in the halls.
I will not skateboard in the halls...

         - Bart Simpson on chalkboard, _The Simpsons_

reply via email to

[Prev in Thread] Current Thread [Next in Thread]