[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#667984: libgtop2: FTBFS(kfreebsd): __printflike undefined

tags 667984 + patch

On 07/04/12 21:35, Robert Millan wrote:
> This section of <sys/conf.h> is protected by "#ifdef _KERNEL".
> It means something in userland is defining that macro. That's very
> wrong! _KERNEL is only supposed to be defined when building kernel
> image or modules.

Thanks for explaining.

libgtop2's sysdeps/freebsd/procmap.c defines _KERNEL, to be able to
include sys/pipe.h, but doesn't undef it before including sys/conf.h
(cdefs gets included within sys/conf.h > eglibc's param.h > limits.h).

I don't see why libgtop2 needs sys/pipe.h at all;  it seems to build
okay without, and it's not meant to be used anyway in userland since 2005:


Steven Chamberlain
Description: Don't include sys/pipe.h on kFreeBSD
 Defining _KERNEL to include sys/pipe.h subsequently breaks sys/conf.h;
 since sys/pipe.h is not meant to be used in userland, and libgtop2 builds
 anyway on kFreeBSD without it, don't include it.
Author: Steven Chamberlain <steven@pyro.eu.org>
Bug-Debian: http://bugs.debian.org/667984

Index: libgtop2-2.28.4/sysdeps/freebsd/procmap.c
--- libgtop2-2.28.4.orig/sysdeps/freebsd/procmap.c	2012-04-07 22:49:20.000000000 +0100
+++ libgtop2-2.28.4/sysdeps/freebsd/procmap.c	2012-04-07 22:51:00.163079809 +0100
@@ -38,10 +38,7 @@
 #include <sys/vnode.h>
 #undef _KVM_VNODE
-#define _KERNEL
-#include <sys/pipe.h>
 #include <sys/conf.h>
-#undef _KERNEL
 #if (__FreeBSD_version >= 800038) || (__FreeBSD_kernel_version >= 800038)
 #define _WANT_FILE
 #include <sys/file.h>

Reply to: