View Issue Details

IDProjectCategoryView StatusLast Update
0000166Pgpool-IIBugpublic2016-02-03 22:09
ReporternrhAssigned ToMuhammad Usama 
Status resolvedResolutionfixed 
PlatformOSfreebsdOS Version10.2-RELEASE-p7
Product Version 
Target VersionFixed in Version 
Summary0000166: V3_5_0 doesn't compile under freebsd
DescriptionThere are a few minor FreeBSDisms not handled by the default compile.
Steps To Reproducedownload pgpool 3.5.0 to a 10.2-RELEASE-p7 freebsd machine running postgresql9.5

./configure && gmake clean && gmake

Fails with errors. The first error is:

depbase=`echo wd_if.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
cc -DHAVE_CONFIG_H -I. -I../../src/include -D_GNU_SOURCE -I /usr/local/include -g -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -MT wd_if.o -MD -MP -MF $depbase.Tpo -c -o wd_if.o wd_if.c &&\
mv -f $depbase.Tpo $depbase.Po
wd_if.c:85:53: error: incomplete definition of type 'struct sockaddr_in'
  ...tmpAddrPtr=&((struct sockaddr_in *)ifa->ifa_addr)->sin_addr;
wd_if.c:85:25: note: forward declaration of 'struct sockaddr_in'
                        tmpAddrPtr=&((struct sockaddr_in *)ifa->ifa_addr...
1 error generated.
Makefile:377: recipe for target 'wd_if.o' failed
gmake[2]: *** [wd_if.o] Error 1
gmake[2]: Leaving directory '/usr/local/src/pgpool2/src/watchdog'
Makefile:957: recipe for target 'all-recursive' failed
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory '/usr/local/src/pgpool2/src'
Makefile:391: recipe for target 'all-recursive' failed
gmake: *** [all-recursive] Error 1

Additional InformationThese patches fix the compile problem. They're a diff from tag V3_5_0:

dev01.db (master)# git diff V3_5_0
diff --git a/src/watchdog/wd_escalation.c b/src/watchdog/wd_escalation.c
index 1634932..e2c79d7 100644
--- a/src/watchdog/wd_escalation.c
+++ b/src/watchdog/wd_escalation.c
@@ -26,6 +26,9 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <errno.h>
+#ifdef __FreeBSD__
+#include <sys/wait.h>
 #include "pool.h"
 #include "utils/elog.h"
diff --git a/src/watchdog/wd_if.c b/src/watchdog/wd_if.c
index 0d290ea..0e942df 100644
--- a/src/watchdog/wd_if.c
+++ b/src/watchdog/wd_if.c
@@ -41,6 +41,9 @@
 #else /* __linux__ */
 #include <net/route.h>
 #include <net/if.h>
+#ifdef __FreeBSD__
+#include <netinet/in.h>
 #ifdef AF_LINK
 #include <net/if_dl.h>
TagsNo tags attached.


Muhammad Usama

2016-02-03 22:08

developer   ~0000645


Thanks for reporting the issue and the patch. I have checked in the fix to 3_5 and master branches.;a=commitdiff;h=fef52de4e72ae466d0813a73507d51a8802e3fc3

Issue History

Date Modified Username Field Change
2016-01-30 02:52 nrh New Issue
2016-01-30 10:48 t-ishii Assigned To => Muhammad Usama
2016-01-30 10:48 t-ishii Status new => assigned
2016-02-03 22:09 Muhammad Usama Note Added: 0000645
2016-02-03 22:09 Muhammad Usama Status assigned => resolved
2016-02-03 22:09 Muhammad Usama Resolution open => fixed