This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: dup3/O_CLOEXEC/F_DUPFD_CLOEXEC


On Wed, Jan 13, 2010 at 09:00:19PM -0700, Eric Blake wrote:
>>    MALLOC_CHECK;
>> -  debug_printf ("dup2 (%d, %d)", oldfd, newfd);
>> +  debug_printf ("dup3 (%d, %d, %d)", oldfd, newfd, flags);
>
>I'd prefer %#x for flags, rather than %d (two instances in this function).

In that case it should be %p to be consistent with other uses.

>> +      set_errno (EBADF);
>> +      return -1;
>> +    }
>> +  if (!cygheap->fdtab.not_open (oldfd) && oldfd == newfd)
>
>Is not_open() expensive?  If so, reverse the order of the conditionals for
>speed.

Yes, not_open() is expensive.

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]