bug-gnulib
[Top][All Lists]
Advanced

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

[proposed PATCH] relocatable-prog: default O_EXEC to O_PATH if available


From: Paul Eggert
Subject: [proposed PATCH] relocatable-prog: default O_EXEC to O_PATH if available
Date: Mon, 05 Nov 2012 14:02:14 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1

* lib/progreloc.c (O_EXEC) [O_PATH]: Default to O_PATH.
This tracks the recent change to fcntl-h.
Perhaps relocatable-prog should depend on fcntl-h instead?
---
 ChangeLog       | 5 +++++
 lib/progreloc.c | 6 +++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 3576e7a..64dab14 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2012-11-05  Paul Eggert  <address@hidden>
 
+       relocatable-prog: default O_EXEC to O_PATH if available
+       * lib/progreloc.c (O_EXEC) [O_PATH]: Default to O_PATH.
+       This tracks the recent change to fcntl-h.
+       Perhaps relocatable-prog should depend on fcntl-h instead?
+
        fcntl-h: default O_SEARCH, O_EXEC to O_PATH if available
        Linux kernel 2.6.39 introduced O_PATH (see
        <http://lwn.net/Articles/433854/>) and this is a better fallback
diff --git a/lib/progreloc.c b/lib/progreloc.c
index c6a541f..1519602 100644
--- a/lib/progreloc.c
+++ b/lib/progreloc.c
@@ -61,7 +61,11 @@
 #endif
 
 #ifndef O_EXEC
-# define O_EXEC O_RDONLY /* This is often close enough in older systems.  */
+# ifdef O_PATH
+#  define O_EXEC O_PATH
+# else
+#  define O_EXEC O_RDONLY /* This is often close enough in older systems.  */
+# endif
 #endif
 
 /* Declare canonicalize_file_name.
-- 
1.7.11.7





reply via email to

[Prev in Thread] Current Thread [Next in Thread]