Commit c7f1b7b5 authored by sbc's avatar sbc Committed by Commit bot

nacl_io: Remove the direct syscall intercept for 'remove'

This is no longer needed as the underlying syscalls
unlink/rmdir and both intercepted at the IRT level.  I
believe this was overlooked when we fixed:
https://code.google.com/p/nativeclient/issues/detail?id=3709

This should fix the recent lua5.2 failures on the
naclports waterfall.

CQ_EXTRA_TRYBOTS=tryserver.chromium.linux:linux_nacl_sdk;tryserver.chromium.mac:mac_nacl_sdk;tryserver.chromium.win:win_nacl_sdk
BUG=487701

Review URL: https://codereview.chromium.org/1136953014

Cr-Commit-Position: refs/heads/master@{#329871}
parent 6d84db54
...@@ -81,7 +81,6 @@ ...@@ -81,7 +81,6 @@
"syscalls/pipe.c", "syscalls/pipe.c",
"syscalls/poll.c", "syscalls/poll.c",
"syscalls/realpath.c", "syscalls/realpath.c",
"syscalls/remove.c",
"syscalls/rename.c", "syscalls/rename.c",
"syscalls/select.c", "syscalls/select.c",
"syscalls/sigaction.c", "syscalls/sigaction.c",
......
/* Copyright (c) 2013 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
#include "nacl_io/kernel_intercept.h"
#include "nacl_io/kernel_wrap.h"
#if defined(__GLIBC__) && defined(__native_client__)
// Glibc's remove(3) and unlink(2) entry points are not yet hooked up
// to the lower level IRT interfaces. Therefore the only way to intercept
// these calls is to override them here.
// TODO(sbc): remove this once glibc plumbing is in place for remove/unlink
int remove(const char* path) {
return ki_remove(path);
}
#endif
...@@ -510,14 +510,13 @@ TEST_F(KernelWrapTest, readlink) { ...@@ -510,14 +510,13 @@ TEST_F(KernelWrapTest, readlink) {
ASSERT_EQ(kDummyErrno, errno); ASSERT_EQ(kDummyErrno, errno);
} }
#ifdef __GLIBC__
// Under newlib there is no remove syscall. Instead it is implemented
// in terms of unlink()/rmdir().
TEST_F(KernelWrapTest, remove) { TEST_F(KernelWrapTest, remove) {
EXPECT_CALL(mock, remove(kDummyConstChar)).WillOnce(Return(-1)); // The remove syscall is not directly intercepted. Instead it is implemented
// in terms of unlink()/rmdir().
EXPECT_CALL(mock, unlink(kDummyConstChar))
.WillOnce(DoAll(SetErrno(kDummyErrno), Return(-1)));
EXPECT_EQ(-1, remove(kDummyConstChar)); EXPECT_EQ(-1, remove(kDummyConstChar));
} }
#endif
TEST_F(KernelWrapTest, rename) { TEST_F(KernelWrapTest, rename) {
EXPECT_CALL(mock, rename(kDummyConstChar, kDummyConstChar2)) EXPECT_CALL(mock, rename(kDummyConstChar, kDummyConstChar2))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment