MonitoringPlug / monitoringplug

My collection of monitoring plugins for Nagios and similar monitoring systems.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FCGI compile error with fcgi-2.4.1

rogersk opened this issue · comments

compile fails with fcgi-2.4.1-SNAP-0311112127 (http://www.fastcgi.com/dist/fcgi.tar.gz)

check_fcgi_ping.c: In function ‘main’:
check_fcgi_ping.c:83:5: error: too few arguments to function ‘OS_Close’
/usr/local/include/fcgios.h:116:12: note: declared here

yes, fcgios.h has a different declaration

116 DLLAPI int OS_Close(int fd, int shutdown);

tried to "fix":

 diff --git a/fcgi/check_fcgi_ping.c b/fcgi/check_fcgi_ping.c
index 048aac3..8cb6d73 100644
--- a/fcgi/check_fcgi_ping.c
+++ b/fcgi/check_fcgi_ping.c
@@ -80,7 +80,7 @@ int main (int argc, char **argv) {
     } while (type != FCGI_GET_VALUES_RESULT);

     /* Close connection */
-    OS_Close(fcgiSock);
+    OS_Close(fcgiSock,1);

     time_delta = mp_time_delta(start_time);
     mp_perfdata_float("time", (float)time_delta, "s", NULL);

POC

./check_fcgi_ping -s /home/fastcgi/php54.fcgi --perfdata
OK - FCGI-Pong: /home/fastcgi/php54.fcgi| time=0.025s;

seems to work with either arg 0 or 1.
btw, in both cases I get a segfault when run without arguments.