git.annexia.org
/
hivex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eef5ef6
)
hivex: Fix building on platforms without O_CLOEXEC such as FreeBSD
author
Hilko Bengen
<bengen@hilluzination.de>
Mon, 22 Aug 2011 17:52:02 +0000
(19:52 +0200)
committer
Richard W.M. Jones
<rjones@redhat.com>
Wed, 24 Aug 2011 11:56:51 +0000
(12:56 +0100)
lib/hivex.c
patch
|
blob
|
history
diff --git
a/lib/hivex.c
b/lib/hivex.c
index
a3f5171
..
4b9fcf0
100644
(file)
--- a/
lib/hivex.c
+++ b/
lib/hivex.c
@@
-294,9
+294,16
@@
hivex_open (const char *filename, int flags)
if (h->filename == NULL)
goto error;
+#ifdef O_CLOEXEC
h->fd = open (filename, O_RDONLY | O_CLOEXEC);
+#else
+ h->fd = open (filename, O_RDONLY);
+#endif
if (h->fd == -1)
goto error;
+#ifndef O_CLOEXEC
+ fcntl (h->fd, F_SETFD, FD_CLOEXEC);
+#endif
struct stat statbuf;
if (fstat (h->fd, &statbuf) == -1)