Verified Commit 2a118ef3 authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

Do not intercept puts

puts has nothing to do with the FS. thus we leave libc handling it
directly
parent 11cee2f8
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -58,8 +58,6 @@ extern void* libc___lxstat64;
extern void* libc_statfs;
extern void* libc_fstatfs;

extern void* libc_puts;

extern void* libc_write;
extern void* libc_pwrite;
extern void* libc_pwrite64;
+0 −4
Original line number Diff line number Diff line
@@ -750,10 +750,6 @@ int fstatfs(int fd, struct statfs* buf) {
    return (reinterpret_cast<decltype(&fstatfs)>(libc_fstatfs))(fd, buf);
}

int puts(const char* str) {
    return (reinterpret_cast<decltype(&puts)>(libc_puts))(str);
}

ssize_t write(int fd, const void* buf, size_t count) {
    init_passthrough_if_needed();
    if(CTX->initialized()) {
+0 −4
Original line number Diff line number Diff line
@@ -62,8 +62,6 @@ void* libc___lxstat64;
void* libc_statfs;
void* libc_fstatfs;

void* libc_puts;

void* libc_write;
void* libc_pwrite;
void* libc_pwrite64;
@@ -157,8 +155,6 @@ void init_passthrough_() {
    libc_statfs = dlsym(libc, "statfs");
    libc_fstatfs = dlsym(libc, "fstatfs");

    libc_puts = dlsym(libc, "puts");

    libc_write = dlsym(libc, "write");
    libc_pwrite = dlsym(libc, "pwrite");
    libc_pwrite64 = dlsym(libc, "pwrite64");