[Box Backup-commit] COMMIT r3453 - box/trunk/lib/intercept

subversion at boxbackup.org subversion at boxbackup.org
Wed Dec 10 23:28:00 GMT 2014


Author: chris
Date: 2014-12-10 23:27:59 +0000 (Wed, 10 Dec 2014)
New Revision: 3453

Modified:
   box/trunk/lib/intercept/intercept.cpp
   box/trunk/lib/intercept/intercept.h
Log:
Fix intercept tests on NetBSD.

Thanks to Jose Luis Rodriguez Garcia for the patch!


Modified: box/trunk/lib/intercept/intercept.cpp
===================================================================
--- box/trunk/lib/intercept/intercept.cpp	2014-12-10 20:57:50 UTC (rev 3452)
+++ box/trunk/lib/intercept/intercept.cpp	2014-12-10 23:27:59 UTC (rev 3453)
@@ -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)

Modified: box/trunk/lib/intercept/intercept.h
===================================================================
--- box/trunk/lib/intercept/intercept.h	2014-12-10 20:57:50 UTC (rev 3452)
+++ box/trunk/lib/intercept/intercept.h	2014-12-10 23:27:59 UTC (rev 3453)
@@ -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>
 




More information about the Boxbackup-commit mailing list