diff options
author | Roland McGrath <roland@gnu.org> | 2008-07-07 00:41:05 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2008-07-07 00:41:05 +0000 |
commit | f20ac01059f1adff71890ca3fc5b9bf62df7e97d (patch) | |
tree | 09fa52f8253dcb4d5dc533cb1a0b7367e6a29e4e /sysdeps/mach/hurd/open.c | |
parent | 45ec3e79a8e0df7eb41e6356b20c15b93ea6ad57 (diff) | |
download | glibc-f20ac01059f1adff71890ca3fc5b9bf62df7e97d.tar.gz glibc-f20ac01059f1adff71890ca3fc5b9bf62df7e97d.tar.xz glibc-f20ac01059f1adff71890ca3fc5b9bf62df7e97d.zip |
2008-07-06 Samuel Thibault <samuel.thibault@ens-lyon.org>
* sysdeps/mach/hurd/open.c: Include <stdio.h>. (__open_2): New function. (__open64_2): New alias to __open_2. * sysdeps/mach/hurd/openat.c: Include <stdio.h>. (__openat_2): New function. (__openat64_2): New alias to __openat_2.
Diffstat (limited to 'sysdeps/mach/hurd/open.c')
-rw-r--r-- | sysdeps/mach/hurd/open.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sysdeps/mach/hurd/open.c b/sysdeps/mach/hurd/open.c index bdfed5e311..519789f22f 100644 --- a/sysdeps/mach/hurd/open.c +++ b/sysdeps/mach/hurd/open.c @@ -19,6 +19,7 @@ #include <errno.h> #include <fcntl.h> #include <stdarg.h> +#include <stdio.h> #include <hurd.h> #include <hurd/fd.h> @@ -52,8 +53,20 @@ weak_alias (__libc_open, __open) libc_hidden_weak (__open) weak_alias (__libc_open, open) +int +__open_2 (file, oflag) + const char *file; + int oflag; +{ + if (oflag & O_CREAT) + __fortify_fail ("invalid open call: O_CREAT without mode"); + + return __open (file, oflag); +} + /* open64 is just the same as open for us. */ weak_alias (__libc_open, __libc_open64) weak_alias (__libc_open, __open64) libc_hidden_weak (_open64) weak_alias (__libc_open, open64) +strong_alias (__open_2, __open64_2) |