Fix some compilation warnings on older systems

* print_statfs.c (print_statfs_flags): Define only
for [HAVE_STRUCT_STATFS_F_FLAGS || HAVE_STRUCT_STATFS64_F_FLAGS].
* tests/inet-cmsg.c (print_origdstaddr): Define only
for [IP_ORIGDSTADDR].
This commit is contained in:
Дмитрий Левин 2016-05-17 20:17:13 +03:00
parent 9164722af0
commit e0ba92016b
2 changed files with 4 additions and 0 deletions

View File

@ -41,6 +41,7 @@ print_statfs_type(const char *const prefix, const unsigned long long magic)
tprintf("%#llx", magic);
}
#if defined HAVE_STRUCT_STATFS_F_FLAGS || defined HAVE_STRUCT_STATFS64_F_FLAGS
static void
print_statfs_flags(const char *const prefix, const unsigned long long flags)
{
@ -49,6 +50,7 @@ print_statfs_flags(const char *const prefix, const unsigned long long flags)
printflags64(statfs_flags, flags, "ST_???");
}
}
#endif /* HAVE_STRUCT_STATFS_F_FLAGS || HAVE_STRUCT_STATFS64_F_FLAGS */
static void
print_statfs_number(const char *const prefix, const unsigned long long number)

View File

@ -75,6 +75,7 @@ print_opts(const char *name, const struct cmsghdr *c)
}
}
#ifdef IP_ORIGDSTADDR
static void
print_origdstaddr(const struct cmsghdr *c)
{
@ -84,6 +85,7 @@ print_origdstaddr(const struct cmsghdr *c)
printf("IP_ORIGDSTADDR, {sa_family=AF_INET, sin_port=htons(%u)"
", sin_addr=inet_addr(\"127.0.0.1\")}", ntohs(sin->sin_port));
}
#endif
int
main(void)