projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
07d7677
)
(fchmod_new): Don't try to close fd if it's < 0.
author
Jim Meyering
<jim@meyering.net>
Tue, 20 Dec 2005 10:24:37 +0000
(10:24 +0000)
committer
Jim Meyering
<jim@meyering.net>
Tue, 20 Dec 2005 10:24:37 +0000
(10:24 +0000)
lib/chmod-safer.c
patch
|
blob
|
history
diff --git
a/lib/chmod-safer.c
b/lib/chmod-safer.c
index 995efdc366dea6e8b6c3d4a1a692a005f1245c29..218a11448c6743f6ef7ce613a6f1de34f675417f 100644
(file)
--- a/
lib/chmod-safer.c
+++ b/
lib/chmod-safer.c
@@
-91,7
+91,7
@@
fchmod_new (char const *file, mode_t mode, dev_t device, mode_t file_type)
saved_errno = errno;
}
- if (close (fd) != 0 && saved_errno == 0)
+ if (
0 <= fd &&
close (fd) != 0 && saved_errno == 0)
saved_errno = errno;
errno = saved_errno;