From b0c02291be915423e396e47baad24543df101879 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Thu, 20 Jun 2013 22:13:04 +0200 Subject: [PATCH] Hook __overflow() correctly. It takes a FILE * and must be hooked with HOOK_FILE*(). --- src/coloredstderr.c | 2 +- src/hookmacros.h | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/coloredstderr.c b/src/coloredstderr.c index 7db0a37..85b2b94 100644 --- a/src/coloredstderr.c +++ b/src/coloredstderr.c @@ -277,7 +277,7 @@ HOOK_FILE1(int, putchar_unlocked, stdout, * stderr (which shouldn't be the case too often). */ #ifdef HAVE_STRUCT__IO_FILE__FILENO /* _IO_FILE is glibc's representation of FILE. */ -HOOK_FD2(int, __overflow, f->_fileno, _IO_FILE *, f, int, ch) +HOOK_FILE2(int, __overflow, f, _IO_FILE *, f, int, ch) #endif /* perror(3) */ diff --git a/src/hookmacros.h b/src/hookmacros.h index 539d0d9..b7df786 100644 --- a/src/hookmacros.h +++ b/src/hookmacros.h @@ -171,12 +171,6 @@ va_end(ap); \ } -#define HOOK_FD2(type, name, fd, type1, arg1, type2, arg2) \ - HOOK_FUNC_DEF2(type, name, type1, arg1, type2, arg2) { \ - _HOOK_PRE_FD(type, name, fd) \ - result = real_ ## name(arg1, arg2); \ - _HOOK_POST_FD(fd) \ - } #define HOOK_FD3(type, name, fd, type1, arg1, type2, arg2, type3, arg3) \ HOOK_FUNC_DEF3(type, name, type1, arg1, type2, arg2, type3, arg3) { \ _HOOK_PRE_FD(type, name, fd) \ -- 2.45.2