[ltt-dev] [PATCH 1/2] Fix lttd's compile failure on fc9

Zhaolei zhaolei at cn.fujitsu.com
Tue Nov 25 01:01:14 EST 2008


Hi,

When compile lttctl 0.58 in fc9, I got following error message:

Making all in lttd
make[2]: Entering directory `/home/zl/ltt-control-0.58-23112008/lttd'
gcc -DHAVE_CONFIG_H -I.. -I..     -g -O2 -MT lttd.o -MD -MP -MF .deps/lttd.Tpo -c -o lttd.o lttd.c
In file included from /usr/include/asm/fcntl.h:2,
                 from /usr/include/linux/fcntl.h:5,
                 from /usr/include/linux/inotify.h:12,
                 from lttd.c:55:
/usr/include/asm-generic/fcntl.h:117: error: redefinition of 'struct flock'
/usr/include/asm-generic/fcntl.h:140: error: redefinition of 'struct flock64'
lttd.c: In function 'read_subbuffer':
lttd.c:467: warning: passing argument 2 of 'splice' from incompatible pointer type
make[2]: *** [lttd.o] Error 1
make[2]: Leaving directory `/home/zl/ltt-control-0.58-23112008/lttd'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/zl/ltt-control-0.58-23112008'
make: *** [all] Error 2
$

It can be fixed by following patch:

Signed-off-by: Zhao Lei <zhaolei at cn.fujitsu.com>
---
diff -Nur ltt-control-0.58-23112008.org/lttd/lttd.c ltt-control-0.58-23112008/lttd/lttd.c
--- ltt-control-0.58-23112008.org/lttd/lttd.c	2008-11-25 13:38:57.000000000 +0800
+++ ltt-control-0.58-23112008/lttd/lttd.c	2008-11-25 13:35:33.000000000 +0800
@@ -51,19 +51,19 @@
 #define RELAY_GET_SUBBUF_SIZE   _IOR(0xF5, 0x03,__u32)
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)
-#include <linux/inotify.h>
+#include <sys/inotify.h>
 /* From the inotify-tools 2.6 package */
-static inline int inotify_init (void)
+inline int inotify_init (void)
 {
 	return syscall (__NR_inotify_init);
 }
 
-static inline int inotify_add_watch (int fd, const char *name, __u32 mask)
+inline int inotify_add_watch (int fd, const char *name, __u32 mask)
 {
 	return syscall (__NR_inotify_add_watch, fd, name, mask);
 }
 
-static inline int inotify_rm_watch (int fd, __u32 wd)
+inline int inotify_rm_watch (int fd, __u32 wd)
 {
 	return syscall (__NR_inotify_rm_watch, fd, wd);
 }




More information about the lttng-dev mailing list