[lkml]   [2008]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: dup2() vs dup3() inconsistency when
    On Fri, 2008-10-10 at 07:04 +0200, Michael Kerrisk wrote:
    > Well, as long as we are fixing the dup3() interface in the way that Al
    > and Ulrich have suggested, what about another fix:
    > give an error if newfd is already open, thus forcing the user to do an
    > explicit close
    > ?
    > This silent close in dup2() is an implementation blemish. Why not eliminate it?

    Apart from the usual "do not break almost all existing apps" killer
    reason: The alternative is that people will simply add a "close(newfd)"
    everytime before "dup2(oldfd,newfd)" since close() is harmless on a
    non-open fd.

    Firmix Software GmbH
    mobil: +43 664 4416156 fax: +43 1 7890849-55
    Embedded Linux Development and Services

     \ /
      Last update: 2008-10-10 14:13    [W:3.392 / U:4.992 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site