diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2007-06-04 20:34:58 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2007-06-04 20:34:58 +0000 |
commit | e84299663ca4d679999ef6bc7a430c354356b3f3 (patch) | |
tree | 5ccbe918b5d6dfc549e7286f2a5557cea7aea63b /libc/io/open.c | |
parent | 0ef72d52eaacd3fbfb4f08adbdf240f8e0aa6c56 (diff) | |
download | eglibc2-e84299663ca4d679999ef6bc7a430c354356b3f3.tar.gz |
Merge changes between r2277 and r2393 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@2394 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/io/open.c')
-rw-r--r-- | libc/io/open.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/libc/io/open.c b/libc/io/open.c index 188110b3f..c10440624 100644 --- a/libc/io/open.c +++ b/libc/io/open.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995, 1996, 1997, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1991,1995,1996,1997,2002,2007 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,6 +20,9 @@ #include <fcntl.h> #include <stdarg.h> #include <stddef.h> +#include <stdio.h> + +extern char **__libc_argv attribute_hidden; /* Open FILE with access OFLAG. If OFLAG includes O_CREAT, a third argument is the file protection. */ @@ -51,4 +54,18 @@ libc_hidden_def (__open) stub_warning (open) weak_alias (__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); +} +stub_warning (__open_2) + #include <stub-tag.h> |