[libglnx] Add --disable-otmpfile



commit c2ba4d879956436c1349acb0aeafd6f885276c67
Author: Colin Walters <walters verbum org>
Date:   Wed Aug 3 11:07:59 2016 -0400

    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

 glnx-fdio.c |    2 +-
 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))
     {
diff --git a/libglnx.m4 b/libglnx.m4
index 6603c09..43dff97 100644
--- a/libglnx.m4
+++ b/libglnx.m4
@@ -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])])
+
 ])
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]