Skip to content

Commit

Permalink
portability fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
schweikert committed Feb 10, 2017
1 parent 3b5c426 commit 08e5cab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -80,7 +80,7 @@ AH_BOTTOM([
])

dnl Checks for header files.
AC_CHECK_HEADERS(unistd.h sys/file.h stdlib.h sys/select.h)
AC_CHECK_HEADERS(unistd.h sys/file.h stdlib.h sys/select.h getopt.h)

AC_CONFIG_FILES([Makefile
doc/Makefile
Expand Down
18 changes: 10 additions & 8 deletions src/fping.c
Expand Up @@ -1593,14 +1593,16 @@ int receive_reply(int socket,
}

#if HAVE_SO_TIMESTAMP
/* ancilliary data */
struct cmsghdr* cmsg;
for (cmsg = CMSG_FIRSTHDR(&recv_msghdr);
cmsg != NULL;
cmsg = CMSG_NXTHDR(&recv_msghdr, cmsg)) {
if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_TIMESTAMP) {
memcpy(reply_timestamp, CMSG_DATA(cmsg), sizeof(*reply_timestamp));
timestamp_set = 1;
{
/* ancilliary data */
struct cmsghdr* cmsg;
for (cmsg = CMSG_FIRSTHDR(&recv_msghdr);
cmsg != NULL;
cmsg = CMSG_NXTHDR(&recv_msghdr, cmsg)) {
if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_TIMESTAMP) {
memcpy(reply_timestamp, CMSG_DATA(cmsg), sizeof(*reply_timestamp));
timestamp_set = 1;
}
}
}
#endif
Expand Down

0 comments on commit 08e5cab

Please sign in to comment.