Package: checkinstall
Severity: important
Tags: patch

Hi,

currently your package FTBFS on GNU/kFreeBSD with the following error:
> gcc -Wall -c -D_GNU_SOURCE -DPIC -fPIC -D_REENTRANT -DVERSION=\"0.7.0beta5\" 
> installwatch.c
> installwatch.c:262: warning: conflicting types for built-in function 'log'
> installwatch.c: In function '__instw_printdirent':
> installwatch.c:851: error: 'struct dirent' has no member named 'd_off'
> installwatch.c:855: warning: format '%ld' expects type 'long int', but 
> argument 4 has type 'unsigned int'
> installwatch.c: In function '__instw_printdirent64':
> installwatch.c:875: error: 'struct dirent64' has no member named 'd_off'
> installwatch.c:879: warning: format '%lld' expects type 'long long int', but 
> argument 4 has type 'unsigned int'
> installwatch.c: In function 'open':
> installwatch.c:2595: warning: 'mode_t' is promoted to 'int' when passed 
> through '...'
> installwatch.c:2595: warning: (so you should pass 'int' not 'mode_t' to 
> 'va_arg')
> installwatch.c:2595: note: if this code is reached, the program will abort
> make[2]: *** [installwatch.o] Error 1

Full build logs are available at
<http://experimental.ftbfs.de/build.php?arch=kfreebsd-i386&pkg=checkinstall>

This is due to the fact that there's no d_off in struct dirent on
GNU/kFreeBSD. Please find attached a patch which fixes this problem, and
shouldn't harm Linux builds.

Cheers,

-- 
Cyril Brulebois
--- checkinstall-1.6.1/installwatch-0.7.0beta5/installwatch.c	2007-03-10 22:02:23.661611000 +0100
+++ checkinstall-1.6.1/installwatch-0.7.0beta5/installwatch.c	2007-03-10 22:12:16.000000000 +0100
@@ -44,6 +44,13 @@
 #include <dlfcn.h>
 #include <dirent.h>
 
+/* There's no d_off on GNU/kFreeBSD */
+#if defined(__FreeBSD_kernel__)
+#define D_OFF(X) (-1)
+#else
+#define D_OFF(X) (X)
+#endif
+
 #include "localdecls.h"
 
 #define DEBUG 1  
@@ -848,7 +855,7 @@
 			"\td_name    : \"%.*s\"\n",
 			entry,
 			entry->d_ino,
-			entry->d_off,
+			D_OFF(entry->d_off),
 			entry->d_reclen,
 			(int)entry->d_type,
 			(int)entry->d_reclen,(char*)(entry->d_name)
@@ -872,7 +879,7 @@
 			"\td_name    : \"%.*s\"\n",
 			entry,
 			entry->d_ino,
-			entry->d_off,
+			D_OFF(entry->d_off),
 			entry->d_reclen,
 			(int)entry->d_type,
 			(int)entry->d_reclen,(char*)(entry->d_name)

Reply via email to