From c13d89b829a83a248130184583cf0332515a05df Mon Sep 17 00:00:00 2001 From: Ben Cheng Date: Thu, 19 Dec 2013 10:24:04 -0800 Subject: [PATCH] Add C linkage for __open_2 and __openat_2. Otherwise Clang mangle them with C++ names. Change-Id: I844e28d834df8b0752b32d2aadd2013fc8804a43 --- libc/bionic/open.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libc/bionic/open.cpp b/libc/bionic/open.cpp index e0dd181db..52c34dccf 100644 --- a/libc/bionic/open.cpp +++ b/libc/bionic/open.cpp @@ -50,7 +50,7 @@ int open(const char* pathname, int flags, ...) { return __openat(AT_FDCWD, pathname, flags, mode); } -int __open_2(const char* pathname, int flags) { +extern "C" 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); } @@ -75,7 +75,7 @@ int openat(int fd, const char *pathname, int flags, ...) { return __openat(fd, pathname, flags, mode); } -int __openat_2(int fd, const char* pathname, int flags) { +extern "C" int __openat_2(int fd, const char* pathname, int flags) { if (flags & O_CREAT) { __fortify_chk_fail("openat(O_CREAT): called without specifying a mode", 0); }