[BZ,#17912] powerpc: Add O_TMPFILE to <fcntl.h>

Message ID mvmegq8ipu6.fsf@hawking.suse.de
State Committed
Headers

Commit Message

Andreas Schwab Feb. 2, 2015, 10:13 a.m. UTC
  This is broken on any architecture with a non-default O_DIRECTORY, so
let's fix it for real.

Andreas.

	[BZ #17912]
	* sysdeps/unix/sysv/linux/bits/fcntl-linux.h (__O_TMPFILE): Define
	in terms of __O_DIRECTORY.
---
 sysdeps/unix/sysv/linux/bits/fcntl-linux.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Rajalakshmi S Feb. 2, 2015, 1:43 p.m. UTC | #1
On 02/02/2015 03:43 PM, Andreas Schwab wrote:
> This is broken on any architecture with a non-default O_DIRECTORY, so
> let's fix it for real.
>
> Andreas.
>
> 	[BZ #17912]
> 	* sysdeps/unix/sysv/linux/bits/fcntl-linux.h (__O_TMPFILE): Define
> 	in terms of __O_DIRECTORY.
> ---
>   sysdeps/unix/sysv/linux/bits/fcntl-linux.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
> index 3d28c84..d2baeb3 100644
> --- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
> +++ b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
> @@ -97,7 +97,7 @@
>   # define __O_DSYNC	 010000
>   #endif
>   #ifndef __O_TMPFILE
> -# define __O_TMPFILE   020200000
> +# define __O_TMPFILE   (020000000 | __O_DIRECTORY)
>   #endif
>
>   #ifndef F_GETLK
Looks ok. Tested on powerpc64le.
  
Roland McGrath Feb. 3, 2015, 6:59 p.m. UTC | #2
> This is broken on any architecture with a non-default O_DIRECTORY, so
> let's fix it for real.

That looks good.
  

Patch

diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
index 3d28c84..d2baeb3 100644
--- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
+++ b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
@@ -97,7 +97,7 @@ 
 # define __O_DSYNC	 010000
 #endif
 #ifndef __O_TMPFILE
-# define __O_TMPFILE   020200000
+# define __O_TMPFILE   (020000000 | __O_DIRECTORY)
 #endif
 
 #ifndef F_GETLK