Consistenly use #ifdef to check for AC_DEFINE'd macros

* aio.c (print_common_flags): Use #ifdef in the check for
HAVE_STRUCT_IOCB_U_C_FLAGS.
* defs.h: Use #ifdef in the check for HAVE_LITTLE_ENDIAN_LONG_LONG.
* net.c: Use #ifdef in the check for HAVE_SENDMSG.
* syscall.c (dumpio): Likewise.
* printstat.h (DO_PRINTSTAT): Use #ifdef in checks for
HAVE_STRUCT_STAT_ST_* macros.
* util.c: Use #ifdef in checks for HAVE_SYS_XATTR_H.
This commit is contained in:
Дмитрий Левин 2015-06-17 20:09:13 +00:00
parent 0c5619538f
commit d93c4e80b3
6 changed files with 10 additions and 10 deletions

2
aio.c
View File

@ -98,7 +98,7 @@ tprint_lio_opcode(unsigned cmd)
static void
print_common_flags(struct iocb *iocb)
{
#if HAVE_STRUCT_IOCB_U_C_FLAGS
#ifdef HAVE_STRUCT_IOCB_U_C_FLAGS
if (iocb->u.c.flags & IOCB_RESFD)
tprintf(", resfd=%d", iocb->u.c.resfd);
if (iocb->u.c.flags & ~IOCB_RESFD)

2
defs.h
View File

@ -497,7 +497,7 @@ extern int print_quoted_string(const char *, unsigned int, unsigned int);
/* a refers to the lower numbered u_arg,
* b refers to the higher numbered u_arg
*/
#if HAVE_LITTLE_ENDIAN_LONG_LONG
#ifdef HAVE_LITTLE_ENDIAN_LONG_LONG
# define LONG_LONG(a,b) \
((long long)((unsigned long long)(unsigned)(a) | ((unsigned long long)(b)<<32)))
#else

2
net.c
View File

@ -280,7 +280,7 @@ printsock(struct tcb *tcp, long addr, int addrlen)
tprints("}");
}
#if HAVE_SENDMSG
#ifdef HAVE_SENDMSG
# ifndef SCM_SECURITY
# define SCM_SECURITY 0x03
# endif

View File

@ -68,14 +68,14 @@ DO_PRINTSTAT(struct tcb *tcp, const STRUCT_STAT *statbuf)
tprintf("st_ctime=%s",
sprinttime(cast ? (time_t) (int) statbuf->st_ctime:
(time_t) statbuf->st_ctime));
#if HAVE_STRUCT_STAT_ST_FLAGS
#ifdef HAVE_STRUCT_STAT_ST_FLAGS
tprintf(", st_flags=%u", (unsigned int) statbuf->st_flags);
#endif
#if HAVE_STRUCT_STAT_ST_FSTYPE
#ifdef HAVE_STRUCT_STAT_ST_FSTYPE
tprintf(", st_fstype=%.*s",
(int) sizeof statbuf->st_fstype, statbuf->st_fstype);
#endif
#if HAVE_STRUCT_STAT_ST_GEN
#ifdef HAVE_STRUCT_STAT_ST_GEN
tprintf(", st_gen=%u", (unsigned int) statbuf->st_gen);
#endif
tprints("}");

View File

@ -669,7 +669,7 @@ dumpio(struct tcb *tcp)
} else if (func == sys_readv) {
dumpiov(tcp, tcp->u_arg[2], tcp->u_arg[1]);
return;
#if HAVE_SENDMSG
#ifdef HAVE_SENDMSG
} else if (func == sys_recvmsg) {
dumpiov_in_msghdr(tcp, tcp->u_arg[1]);
return;
@ -687,7 +687,7 @@ dumpio(struct tcb *tcp)
dumpstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
else if (func == sys_writev)
dumpiov(tcp, tcp->u_arg[2], tcp->u_arg[1]);
#if HAVE_SENDMSG
#ifdef HAVE_SENDMSG
else if (func == sys_sendmsg)
dumpiov_in_msghdr(tcp, tcp->u_arg[1]);
else if (func == sys_sendmmsg)

4
util.c
View File

@ -34,7 +34,7 @@
#include "defs.h"
#include <sys/param.h>
#include <fcntl.h>
#if HAVE_SYS_XATTR_H
#ifdef HAVE_SYS_XATTR_H
# include <sys/xattr.h>
#endif
#include <sys/uio.h>
@ -435,7 +435,7 @@ sprinttime(time_t t)
static char *
getfdproto(struct tcb *tcp, int fd, char *buf, unsigned bufsize)
{
#if HAVE_SYS_XATTR_H
#ifdef HAVE_SYS_XATTR_H
ssize_t r;
char path[sizeof("/proc/%u/fd/%u") + 2 * sizeof(int)*3];