From d4e7f5576627d9bc15cd458e23aafe4b6ef809d6 Mon Sep 17 00:00:00 2001 From: froz Date: Tue, 20 Aug 2024 15:41:46 +0200 Subject: [PATCH] Remove functions hook for close because there is no point of testing them --- library/srcs/hook/functions/semaphore.c | 1 - library/srcs/hook/functions/stdio.c | 4 ---- library/srcs/hook/functions/unistd.c | 2 -- 3 files changed, 7 deletions(-) diff --git a/library/srcs/hook/functions/semaphore.c b/library/srcs/hook/functions/semaphore.c index 526a1ed..4c7b61a 100644 --- a/library/srcs/hook/functions/semaphore.c +++ b/library/srcs/hook/functions/semaphore.c @@ -58,7 +58,6 @@ sem_t *EXPORT sem_open(const char *name, int oflag, ...) return ret; } -DEFINE_HOOK_FUNCTION(int, sem_close, EAGAIN, -1, sem_t *, sem); DEFINE_HOOK_FUNCTION(int, sem_unlink, EAGAIN, -1, const char *, name); DEFINE_HOOK_FUNCTION(int, sem_wait, EAGAIN, -1, sem_t *, sem); DEFINE_HOOK_FUNCTION(int, sem_trywait, EAGAIN, -1, sem_t *, sem); diff --git a/library/srcs/hook/functions/stdio.c b/library/srcs/hook/functions/stdio.c index 2c33598..dbb9e2a 100644 --- a/library/srcs/hook/functions/stdio.c +++ b/library/srcs/hook/functions/stdio.c @@ -27,7 +27,6 @@ DEFINE_HOOK_FUNCTION(int, remove, EACCES, -1, const char *, path); DEFINE_HOOK_FUNCTION(int, rename, EACCES, -1, const char *, oldpath, const char *, newpath); DEFINE_HOOK_FUNCTION(int, renameat, EACCES, -1, int, olddirfd, const char *, oldpath, int, newdirfd, const char *, newpath); DEFINE_HOOK_FUNCTION(int, renameat2, EACCES, -1, int, olddirfd, const char *, oldpath, int, newdirfd, const char *, newpath, unsigned int, flags); -DEFINE_HOOK_FUNCTION(int, fclose, EIO, EOF, FILE *, stream); DEFINE_HOOK_FUNCTION(file_ptr_t, tmpfile, ENOSPC, NULL); DEFINE_HOOK_FUNCTION(file_ptr_t, tmpfile64, ENOSPC, NULL); DEFINE_HOOK_FUNCTION(char_ptr_t, tmpnam, ENOSPC, NULL, char_array_L_tmpnam_t, s); @@ -35,7 +34,6 @@ DEFINE_HOOK_FUNCTION(char_ptr_t, tmpnam_r, ENOSPC, NULL, char_array_L_tmpnam_t, DEFINE_HOOK_FUNCTION(char_ptr_t, tempnam, ENOSPC, NULL, const char *, dir, const char *, pfx); DEFINE_HOOK_FUNCTION(int, fflush, EIO, EOF, FILE *, stream); DEFINE_HOOK_FUNCTION(int, fflush_unlocked, EIO, EOF, FILE *, stream); -DEFINE_HOOK_FUNCTION(int, fcloseall, EIO, EOF); DEFINE_HOOK_FUNCTION(file_ptr_t, fopen, EACCES, NULL, const char *, path, const char *, mode); DEFINE_HOOK_FUNCTION(file_ptr_t, freopen, EACCES, NULL, const char *, path, const char *, mode, FILE *, stream); @@ -131,8 +129,6 @@ DEFINE_HOOK_FUNCTION(int, ferror, EIO, 0, FILE *, stream); DEFINE_HOOK_FUNCTION(int, fileno, EIO, -1, FILE *, stream); DEFINE_HOOK_FUNCTION(int, fileno_unlocked, EIO, -1, FILE *, stream); -DEFINE_HOOK_FUNCTION(int, pclose, EIO, -1, FILE *, stream); - DEFINE_HOOK_FUNCTION(file_ptr_t, popen, EIO, NULL, const char *, command, const char *, type); DEFINE_HOOK_FUNCTION(char_ptr_t, ctermid, EIO, NULL, char *, s); diff --git a/library/srcs/hook/functions/unistd.c b/library/srcs/hook/functions/unistd.c index e161816..9a33f62 100644 --- a/library/srcs/hook/functions/unistd.c +++ b/library/srcs/hook/functions/unistd.c @@ -36,8 +36,6 @@ DEFINE_HOOK_FUNCTION(int, faccessat, EACCES, -1, int, dirfd, const char *, name, DEFINE_HOOK_FUNCTION(__off_t, lseek, EIO, -1, int, fd, __off_t, offset, int, whence); DEFINE_HOOK_FUNCTION(__off64_t, lseek64, EIO, -1, int, fd, __off64_t, offset, int, whence); -DEFINE_HOOK_FUNCTION(int, close, EIO, -1, int, fd); - DEFINE_HOOK_FUNCTION(ssize_t, read, EIO, -1, int, fd, void *, buf, size_t, count); DEFINE_HOOK_FUNCTION(ssize_t, write, EIO, -1, int, fd, const void *, buf, size_t, count);