projects
/
debian
/
gzip
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New upstream version 1.9
[debian/gzip]
/
lib
/
opendir-safer.c
diff --git
a/lib/opendir-safer.c
b/lib/opendir-safer.c
index 8af9847281f043274efaaff92ab288bb97f17866..898e9a0496b33fe419fd7ecd4133e66aa830e747 100644
(file)
--- a/
lib/opendir-safer.c
+++ b/
lib/opendir-safer.c
@@
-1,6
+1,6
@@
/* Invoke opendir, but avoid some glitches.
/* Invoke opendir, but avoid some glitches.
- Copyright (C) 2009-201
6
Free Software Foundation, Inc.
+ Copyright (C) 2009-201
8
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
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
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 <http://www.gnu.org/licenses/>. */
+ along with this program. If not, see <http
s
://www.gnu.org/licenses/>. */
/* Written by Eric Blake. */
/* Written by Eric Blake. */
@@
-22,8
+22,8
@@
#include "dirent-safer.h"
#include <errno.h>
#include "dirent-safer.h"
#include <errno.h>
+#include <fcntl.h>
#include <unistd.h>
#include <unistd.h>
-#include "unistd-safer.h"
/* Like opendir, but do not clobber stdin, stdout, or stderr. */
/* 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
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;
if (f < 0)
{
e = errno;