X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=lib%2Fopendir-safer.c;h=898e9a0496b33fe419fd7ecd4133e66aa830e747;hb=659cae49714b93487242525dfa0e5737463d78d8;hp=0052ce1dadfbfe2768684cec498021e25e9a78f0;hpb=d57728a6ca2413a7c564d8b7bb13d9e5a5a180f3;p=debian%2Fgzip
diff --git a/lib/opendir-safer.c b/lib/opendir-safer.c
index 0052ce1..898e9a0 100644
--- a/lib/opendir-safer.c
+++ b/lib/opendir-safer.c
@@ -1,6 +1,6 @@
/* Invoke opendir, but avoid some glitches.
- Copyright (C) 2009-2013 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 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
@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see . */
+ along with this program. If not, see . */
/* Written by Eric Blake. */
@@ -22,8 +22,8 @@
#include "dirent-safer.h"
#include
+#include
#include
-#include "unistd-safer.h"
/* Like opendir, but do not clobber stdin, stdout, or stderr. */
@@ -49,7 +49,7 @@ opendir_safer (char const *name)
DIR *newdp;
int e;
#if HAVE_FDOPENDIR || GNULIB_FDOPENDIR
- int f = dup_safer (fd);
+ int f = fcntl (fd, F_DUPFD_CLOEXEC, STDERR_FILENO + 1);
if (f < 0)
{
e = errno;