check_icmp fails to compile on Solaris 10 and 11 (#1317)

doombirdAD notifications at github.com
Fri Jan 2 20:23:35 CET 2015


I found the fix in 2 hacks:

1. `MSG_CONFIRM` is not defined in socket.h on Solaris.  I added an
`#ifndef` line to define it at the beginning of check_icmp.c.  There appears
to be a section devoted to "sometimes undefined system macros" so that seems
to be the right place for it.
2. `_XOPEN_SOURCE` needs to be defined to use the version of the msghdr
struct that has "msg_control" and "msg_controllen".  I don't know where the
"standardized" place to put this would be.  I just added a
`check_icmp_CFLAGS = $(AM_CFLAGS) -D_XOPEN_SOURCE=500` to the
plugins-root/Makefile.am.  I didn't know what else might be affected by
adding that definition, so I limited scope to just the file that needs it.

With these two fixes, I was able to compile on both 10 and 11.	I also
compiled on my CentOS 7 box and was able to build RPMs and run check_icmp
without issue.

-- 
Reply to this email on GitHub:
https://github.com/monitoring-plugins/monitoring-plugins/issues/1317#issuecomment-68553876
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20150102/8c946418/attachment.html>


More information about the Devel mailing list