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

Mathieu Desnoyers compudj at krystal.dyndns.org
Tue Nov 25 01:41:35 EST 2008


* Zhaolei (zhaolei at cn.fujitsu.com) wrote:
> 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>

This first change looks sane but,

>  /* From the inotify-tools 2.6 package */
> -static inline int inotify_init (void)
> +inline int inotify_init (void)

why are you removing the static declaration here ?

>  {
>  	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);
>  }
> 
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> 

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68




More information about the lttng-dev mailing list