Skip to content
Snippets Groups Projects
Commit c2ba4d87 authored by Colin Walters's avatar Colin Walters
Browse files

Add --disable-otmpfile

Some systems have bugs with it, so let's allow downstreams to easily
disable it.

https://bugzilla.gnome.org/show_bug.cgi?id=769453
https://github.com/ostreedev/ostree/issues/421
parent 80e5af92
No related branches found
No related tags found
No related merge requests found
...@@ -122,7 +122,7 @@ glnx_open_tmpfile_linkable_at (int dfd, ...@@ -122,7 +122,7 @@ glnx_open_tmpfile_linkable_at (int dfd,
* tempoary path name used is returned in "ret_path". Use * tempoary path name used is returned in "ret_path". Use
* link_tmpfile() below to rename the result after writing the file * link_tmpfile() below to rename the result after writing the file
* in full. */ * in full. */
#ifdef O_TMPFILE #if defined(O_TMPFILE) && !defined(DISABLE_OTMPFILE)
fd = openat (dfd, subpath, O_TMPFILE|flags, 0600); fd = openat (dfd, subpath, O_TMPFILE|flags, 0600);
if (fd == -1 && !(errno == ENOSYS || errno == EISDIR || errno == EOPNOTSUPP)) if (fd == -1 && !(errno == ENOSYS || errno == EISDIR || errno == EOPNOTSUPP))
{ {
......
...@@ -12,4 +12,13 @@ AC_CHECK_DECLS([ ...@@ -12,4 +12,13 @@ AC_CHECK_DECLS([
#include <linux/loop.h> #include <linux/loop.h>
#include <linux/random.h> #include <linux/random.h>
]]) ]])
AC_ARG_ENABLE(otmpfile,
[AS_HELP_STRING([--disable-otmpfile],
[Disable use of O_TMPFILE [default=no]])],,
[enable_otmpfile=yes])
AS_IF([test $enable_otmpfile = yes], [], [
AC_DEFINE([DISABLE_OTMPFILE], 1, [Define if we should avoid using O_TMPFILE])])
]) ])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment