[Box Backup-commit] #72: Patch intercept.h and intercept.c for NetBSD 4 and 5
Box Backup
trac at boxbackup.org
Sun Apr 11 02:53:09 BST 2010
#72: Patch intercept.h and intercept.c for NetBSD 4 and 5
-----------------------+----------------------------------------------------
Reporter: joseyluis | Type: defect
Status: new | Priority: normal
Milestone: | Component: test suite
Version: trunk | Keywords:
-----------------------+----------------------------------------------------
With this test the test suite works with NetBSD 4 and 5 probably, I have
tested it with NetBSD 4. Previously raidfile and bbackupd test didn't
work.
The problem is that in NetBSD 4/5 the readdir and openddir functions
in libc library are called: __readdir30 and __opendir30.
readdir and closedir exist for compatibility with these functions in
NetBSD 3 and previous versions.
There was a change in the ABI between the 3 and 4 version for use
64 bits inodes in kernel instead of 32 bits.
--- intercept.h.orig 2010-04-04 01:58:54.000000000 +0200
+++ intercept.h 2010-04-04 02:00:33.000000000 +0200
@@ -13,6 +13,18 @@
#include <dirent.h>
+#ifdef __NetBSD__ //__NetBSD_Version__ is defined in sys/param.h
+#include <sys/param.h>
+#endif
+
+#if defined __NetBSD_Version__ && __NetBSD_Version__ >= 399000800
//3.99.8 vers.
+#define FUNC_OPENDIR "__opendir30"
+#define FUNC_READDIR "__readdir30"
+#else
+#define FUNC_OPENDIR "opendir"
+#define FUNC_READDIR "readdir"
+#endif
+
#include <sys/types.h>
#include <sys/stat.h>
--- intercept.cpp.orig 2010-04-04 01:58:54.000000000 +0200
+++ intercept.cpp 2010-04-04 02:00:34.000000000 +0200
@@ -514,7 +514,7 @@
{
if (opendir_real == NULL)
{
- opendir_real = (opendir_t*)find_function("opendir");
+ opendir_real = (opendir_t*)find_function(FUNC_OPENDIR);
}
if (opendir_real == NULL)
@@ -547,7 +547,7 @@
if (readdir_real == NULL)
{
- readdir_real = (readdir_t*)find_function("readdir");
+ readdir_real = (readdir_t*)find_function(FUNC_READDIR);
}
if (readdir_real == NULL)
--
Ticket URL: <https://www.boxbackup.org/trac/ticket/72>
Box Backup <http://www.boxbackup.org/>
An open source, completely automatic on-line backup system for UNIX.
More information about the Boxbackup-commit
mailing list