[Rpm-maint] Missing libgen.h

Giulio Eulisse Giulio.Eulisse at cern.ch
Tue Jul 20 16:40:29 UTC 2010


I'm building rpm 4.8.0 on a 64 bit MacOSX 10.6.4 (Snow Leopard). I get
a segmentation fault in build/files.c at line 2168, because of the
missing inclusion of libgen.h, which makes the compiler think (and
warn) about basename returning an int, which causes obvious troubles
on 64 bit.

The appended patch fixes the problem for me.


diff --git a/build/files.c b/build/files.c
index 79020ba..6e607f2 100644
--- a/build/files.c
+++ b/build/files.c
@@ -25,6 +25,7 @@
 #include "build/buildio.h"

 #include "debug.h"
+#include <libgen.h>

 #define SKIPSPACE(s) { while (*(s) && risspace(*(s))) (s)++; }
 #define        SKIPWHITE(_x)   {while(*(_x) && (risspace(*_x) ||
*(_x) == ',')) (_x)++;}

More information about the Rpm-maint mailing list