Paul Eggert wrote:

>>From: [EMAIL PROTECTED] (Paul Jarc)
>>Date: Fri, 09 Aug 2002 14:25:20 -0400
>>
>>Derek Robert Price <[EMAIL PROTECTED]> 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.

Derek

-- 
                *8^)

Email: [EMAIL PROTECTED]

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_





_______________________________________________
Bug-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-cvs

Reply via email to