diff options
author | Colin Walters <walters@verbum.org> | 2016-08-03 11:07:59 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2016-08-03 11:39:16 -0400 |
commit | c2ba4d879956436c1349acb0aeafd6f885276c67 (patch) | |
tree | 82fa2e6325367b25190664ddf4468082feb194cd | |
parent | 80e5af921878adfd99ec2e6cb974d88b3f6f5041 (diff) | |
download | libglnx-c2ba4d879956436c1349acb0aeafd6f885276c67.tar.gz |
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
-rw-r--r-- | glnx-fdio.c | 2 | ||||
-rw-r--r-- | libglnx.m4 | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/glnx-fdio.c b/glnx-fdio.c index f4648ed..8200660 100644 --- a/glnx-fdio.c +++ b/glnx-fdio.c @@ -122,7 +122,7 @@ glnx_open_tmpfile_linkable_at (int dfd, * tempoary path name used is returned in "ret_path". Use * link_tmpfile() below to rename the result after writing the file * in full. */ -#ifdef O_TMPFILE +#if defined(O_TMPFILE) && !defined(DISABLE_OTMPFILE) fd = openat (dfd, subpath, O_TMPFILE|flags, 0600); if (fd == -1 && !(errno == ENOSYS || errno == EISDIR || errno == EOPNOTSUPP)) { @@ -12,4 +12,13 @@ AC_CHECK_DECLS([ #include <linux/loop.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])]) + ]) + |