| 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);
|
| }
|
|
|
|
|