Skip to content

Commit

Permalink
Remove functions hook for close because there is no point of testing …
Browse files Browse the repository at this point in the history
…them
  • Loading branch information
froz42 committed Aug 20, 2024
1 parent e939b3c commit d4e7f55
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 7 deletions.
1 change: 0 additions & 1 deletion library/srcs/hook/functions/semaphore.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 0 additions & 4 deletions library/srcs/hook/functions/stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@ 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);
DEFINE_HOOK_FUNCTION(char_ptr_t, tmpnam_r, ENOSPC, NULL, char_array_L_tmpnam_t, s);
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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions library/srcs/hook/functions/unistd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit d4e7f55

Please sign in to comment.