X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gnu%2Fdup2.c;h=0e13214c82565bc7befe8bf1ca15d45536801816;hb=d30babc23b4f25be970ada2e63a50220a3672281;hp=172f24e79af68d59749901c154372ce4548806b6;hpb=daa269958ad8d50ef8154ccb65e58acaf7a6dd99;p=debian%2Ftar diff --git a/gnu/dup2.c b/gnu/dup2.c index 172f24e7..0e13214c 100644 --- a/gnu/dup2.c +++ b/gnu/dup2.c @@ -1,8 +1,6 @@ -/* -*- buffer-read-only: t -*- vi: set ro: */ -/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Duplicate an open file descriptor to a specified file descriptor. - Copyright (C) 1999, 2004-2007, 2009-2013 Free Software Foundation, Inc. + Copyright (C) 1999, 2004-2007, 2009-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -98,7 +96,11 @@ rpl_dup2 (int fd, int desired_fd) /* On Linux kernels 2.6.26-2.6.29, dup2 (fd, fd) returns -EBADF. On Cygwin 1.5.x, dup2 (1, 1) returns 0. On Cygwin 1.7.17, dup2 (1, -1) dumps core. + On Cygwin 1.7.25, dup2 (1, 256) can dump core. On Haiku, dup2 (fd, fd) mistakenly clears FD_CLOEXEC. */ +# if HAVE_SETDTABLESIZE + setdtablesize (desired_fd + 1); +# endif if (desired_fd < 0) fd = desired_fd; if (fd == desired_fd)