projects
/
debian
/
tar
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Import upstream version 1.27
[debian/tar]
/
gnu
/
opendir-safer.c
diff --git
a/gnu/opendir-safer.c
b/gnu/opendir-safer.c
index 3d8007ab33b794571ae39169ef5c9f6363c558bf..98272f4bc1e8830e6ea4337402db0fa3e3d0c32d 100644
(file)
--- a/
gnu/opendir-safer.c
+++ b/
gnu/opendir-safer.c
@@
-2,7
+2,7
@@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Invoke opendir, but avoid some glitches.
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Invoke opendir, but avoid some glitches.
- Copyright (C) 2009-201
1
Free Software Foundation, Inc.
+ Copyright (C) 2009-201
3
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
@@
-52,10
+52,18
@@
opendir_safer (char const *name)
int e;
#if HAVE_FDOPENDIR || GNULIB_FDOPENDIR
int f = dup_safer (fd);
int e;
#if HAVE_FDOPENDIR || GNULIB_FDOPENDIR
int f = dup_safer (fd);
- newdp = fdopendir (f);
- e = errno;
- if (! newdp)
- close (f);
+ if (f < 0)
+ {
+ e = errno;
+ newdp = NULL;
+ }
+ else
+ {
+ newdp = fdopendir (f);
+ e = errno;
+ if (! newdp)
+ close (f);
+ }
#else /* !FDOPENDIR */
newdp = opendir_safer (name);
e = errno;
#else /* !FDOPENDIR */
newdp = opendir_safer (name);
e = errno;