Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(837)

Unified Diff: native_client_sdk/src/libraries/nacl_io/kernel_wrap_bionic.cc

Issue 576363002: [NaCl SDK] nacl_io: handle null irt function pointers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | native_client_sdk/src/libraries/nacl_io/kernel_wrap_glibc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/libraries/nacl_io/kernel_wrap_bionic.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_wrap_bionic.cc b/native_client_sdk/src/libraries/nacl_io/kernel_wrap_bionic.cc
index 7bdf4f9862e29f4d03cbd011ed95cc1f87ae8152..621e0bd5e922efbe9aaa09698d6c6f16c3c00d32 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_wrap_bionic.cc
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_wrap_bionic.cc
@@ -338,13 +338,11 @@ static void assign_real_pointers() {
}
#define CHECK_REAL(func) \
- if (!REAL(func)) \
- assign_real_pointers();
-
-#define CHECK_REAL_NOSYS(func) \
- CHECK_REAL(func) \
- if (!REAL(func)) \
- return ENOSYS;
+ if (!REAL(func)) { \
+ assign_real_pointers(); \
+ if (!REAL(func)) \
+ return ENOSYS; \
+ }
// "real" functions, i.e. the unwrapped original functions.
@@ -436,7 +434,7 @@ int _real_lseek(int fd, int64_t offset, int whence, int64_t* new_offset) {
int _real_lstat(const char* path, struct stat* buf) {
struct nacl_abi_stat st;
- CHECK_REAL(fstat);
+ CHECK_REAL(lstat);
int err = REAL(lstat)(path, (struct stat*)&st);
if (err) {
@@ -504,7 +502,7 @@ int _real_write(int fd, const void* buf, size_t count, size_t* nwrote) {
}
int _real_getcwd(char* pathname, size_t len) {
- CHECK_REAL_NOSYS(getcwd);
+ CHECK_REAL(getcwd);
return REAL(getcwd)(pathname, len);
}
« no previous file with comments | « no previous file | native_client_sdk/src/libraries/nacl_io/kernel_wrap_glibc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698