git.annexia.org
/
hivex.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Include libintl.h to silence warning about bindtextdomain, textdomain.
[hivex.git]
/
lib
/
hivex.c
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;
if (h->filename == NULL)
goto error;
+#ifdef O_CLOEXEC
h->fd = open (filename, O_RDONLY | O_CLOEXEC);
h->fd = open (filename, O_RDONLY | O_CLOEXEC);
+#else
+ h->fd = open (filename, O_RDONLY);
+#endif
if (h->fd == -1)
goto error;
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)
struct stat statbuf;
if (fstat (h->fd, &statbuf) == -1)