diff options
author | Elliott Hughes <enh@google.com> | 2013-10-15 16:43:38 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2013-10-15 16:49:28 -0700 |
commit | d1eda33f012e46083b91e087fb79d14a5ce70f0e (patch) | |
tree | 2d075e9d43c3a300327e79ee27c5b8330d8dce4c /libc/bionic/open.c | |
parent | dc9d8d050a43e1cd32f1337e79187124bb15d938 (diff) | |
download | android_bionic-d1eda33f012e46083b91e087fb79d14a5ce70f0e.tar.gz android_bionic-d1eda33f012e46083b91e087fb79d14a5ce70f0e.tar.bz2 android_bionic-d1eda33f012e46083b91e087fb79d14a5ce70f0e.zip |
Avoid confusing "read prevented write" log messages.
Moving to a "function: message" style avoids ambiguity.
Change-Id: If9d590e50265c61725d3673bd03796e65edd2d5e
Diffstat (limited to 'libc/bionic/open.c')
-rw-r--r-- | libc/bionic/open.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/libc/bionic/open.c b/libc/bionic/open.c index cde3029c1..6441dc28c 100644 --- a/libc/bionic/open.c +++ b/libc/bionic/open.c @@ -33,30 +33,27 @@ extern int __open(const char*, int, int); -int open(const char *pathname, int flags, ...) -{ - mode_t mode = 0; +int open(const char* pathname, int flags, ...) { + mode_t mode = 0; - flags |= O_LARGEFILE; + flags |= O_LARGEFILE; - if (flags & O_CREAT) - { - va_list args; + if (flags & O_CREAT) { + va_list args; + va_start(args, flags); + mode = (mode_t) va_arg(args, int); + va_end(args); + } - va_start(args, flags); - mode = (mode_t) va_arg(args, int); - va_end(args); - } - - return __open(pathname, flags, mode); + return __open(pathname, flags, mode); } -int __open_2(const char *pathname, int flags) { - if (__predict_false(flags & O_CREAT)) { - __fortify_chk_fail("open(O_CREAT) called without specifying a mode", 0); - } +int __open_2(const char* pathname, int flags) { + if (__predict_false(flags & O_CREAT)) { + __fortify_chk_fail("open(O_CREAT): called without specifying a mode", 0); + } - flags |= O_LARGEFILE; + flags |= O_LARGEFILE; - return __open(pathname, flags, 0); + return __open(pathname, flags, 0); } |