Skip to content

Commit

Permalink
Use a macro to try using the real functions instead of wrappers.
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed Jun 10, 2011
1 parent 51dfda2 commit 9bdc72a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/common.h
Expand Up @@ -63,6 +63,9 @@ extern char **environ;

#ifdef DEFINE_HOOK_GLOBALS
# define HOOK_GLOBAL
# ifndef DONT_BYPASS_HOOKS
# error HOOK_GLOBAL can't be defined without DONT_BYPASS_HOOKS
# endif
#else
# define HOOK_GLOBAL extern
#endif
Expand Down
1 change: 1 addition & 0 deletions src/hook-socket.c
@@ -1,5 +1,6 @@

#define DEFINE_HOOK_GLOBALS 1
#define DONT_BYPASS_HOOKS 1

#include "common.h"
#include "filter.h"
Expand Down
5 changes: 4 additions & 1 deletion src/hook-socket.h
Expand Up @@ -2,7 +2,10 @@
#ifndef __HOOK_SOCKET_H__
#define __HOOK_SOCKET_H__ 1

HOOK_GLOBAL int (* __real_socket)(int domain, int type, int protocol);
DLL_PUBLIC int INTERPOSE(socket)(int domain, int type, int protocol);
HOOK_GLOBAL int (* __real_socket)(int domain, int type, int protocol);
#ifndef DONT_BYPASS_HOOKS
# define socket __real_socket
#endif

#endif
2 changes: 2 additions & 0 deletions src/interpose.c
@@ -1,4 +1,6 @@

#define DONT_BYPASS_HOOKS 1

#include "common.h"

#ifdef USE_INTERPOSERS
Expand Down

0 comments on commit 9bdc72a

Please sign in to comment.