Ticket #72: patch.intercept

File patch.intercept, 1.0 KB (added by joseyluis, 2 years ago)
Line 
1--- intercept.h.orig    2010-04-04 01:58:54.000000000 +0200
2+++ intercept.h 2010-04-04 02:00:33.000000000 +0200
3@@ -13,6 +13,18 @@
4 
5 #include <dirent.h>
6 
7+#ifdef __NetBSD__  //__NetBSD_Version__ is defined in sys/param.h
8+#include <sys/param.h>
9+#endif
10+
11+#if defined __NetBSD_Version__ && __NetBSD_Version__ >= 399000800 //3.99.8 vers.
12+#define FUNC_OPENDIR "__opendir30"
13+#define FUNC_READDIR "__readdir30"
14+#else
15+#define FUNC_OPENDIR "opendir"
16+#define FUNC_READDIR "readdir"
17+#endif
18+
19 #include <sys/types.h>
20 #include <sys/stat.h>
21 
22--- intercept.cpp.orig  2010-04-04 01:58:54.000000000 +0200
23+++ intercept.cpp       2010-04-04 02:00:34.000000000 +0200
24@@ -514,7 +514,7 @@
25 {
26        if (opendir_real == NULL)
27        {
28-               opendir_real = (opendir_t*)find_function("opendir");
29+               opendir_real = (opendir_t*)find_function(FUNC_OPENDIR);
30        }
31 
32        if (opendir_real == NULL)
33@@ -547,7 +547,7 @@
34 
35        if (readdir_real == NULL)
36        {
37-               readdir_real = (readdir_t*)find_function("readdir");
38+               readdir_real = (readdir_t*)find_function(FUNC_READDIR);
39        }
40 
41        if (readdir_real == NULL)