]> ruderich.org/simon Gitweb - coloredstderr/coloredstderr.git/commitdiff
Hook __overflow() correctly.
authorSimon Ruderich <simon@ruderich.org>
Thu, 20 Jun 2013 20:13:04 +0000 (22:13 +0200)
committerSimon Ruderich <simon@ruderich.org>
Thu, 20 Jun 2013 20:13:04 +0000 (22:13 +0200)
It takes a FILE * and must be hooked with HOOK_FILE*().

src/coloredstderr.c
src/hookmacros.h

index 7db0a37abe33bb4291f0a0f1e579163c8bb1034d..85b2b941b88f9d76c58a0f14eb0dd4181dc3a3c9 100644 (file)
@@ -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) */
index 539d0d9d93fc241ca360df59cc9e4a9db6ee8033..b7df7860c66d4c41f9659bc8e56339ac469e8687 100644 (file)
         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) \