From af7948ffbda18e8f46088e52b05b2750b1171de4 Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Tue, 7 Aug 2012 14:06:00 -0700 Subject: [PATCH] Refresh of dbg-out --- src/preload.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/preload.c b/src/preload.c index 53f85432..4ebcc858 100644 --- a/src/preload.c +++ b/src/preload.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -98,6 +99,8 @@ static int rq_size; static int sq_inline; static int fork_support; +static FILE *fout; + enum fd_type { fd_normal, fd_rsocket, @@ -286,6 +289,7 @@ static void init_preload(void) rs.getsockopt = dlsym(RTLD_DEFAULT, "rgetsockopt"); rs.fcntl = dlsym(RTLD_DEFAULT, "rfcntl"); + fout = fopen("rs-out.txt", "w+"); getenv_options(); init = 1; out: @@ -968,12 +972,17 @@ int __fxstat64(int ver, int socket, struct stat64 *buf) { int fd, ret; + init_preload(); + fprintf(fout, "fxstat64 socket %d\n", socket); if (fd_get(socket, &fd) == fd_rsocket) { ret = real.fxstat64(ver, socket, buf); + fprintf(fout, "fxstat64 - rsocket %d\n", ret); if (!ret) buf->st_mode = (buf->st_mode & ~S_IFMT) | __S_IFSOCK; } else { ret = real.fxstat64(ver, fd, buf); + fprintf(fout, "fxstat64 - normal %d\n", ret); } + fflush(fout); return ret; } -- 2.45.2