From d93c4e80b3cf1e04cef218aef32a77be8b7bcd2f Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Wed, 17 Jun 2015 20:09:13 +0000 Subject: [PATCH] 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. --- aio.c | 2 +- defs.h | 2 +- net.c | 2 +- printstat.h | 6 +++--- syscall.c | 4 ++-- util.c | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/aio.c b/aio.c index 7d8fb650..e5905cbd 100644 --- a/aio.c +++ b/aio.c @@ -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) diff --git a/defs.h b/defs.h index c02f8103..7e0b9487 100644 --- a/defs.h +++ b/defs.h @@ -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 diff --git a/net.c b/net.c index aae04980..c570b7a1 100644 --- a/net.c +++ b/net.c @@ -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 diff --git a/printstat.h b/printstat.h index 53112fea..033d4a0a 100644 --- a/printstat.h +++ b/printstat.h @@ -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("}"); diff --git a/syscall.c b/syscall.c index 23ed53fe..0d26b45c 100644 --- a/syscall.c +++ b/syscall.c @@ -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) diff --git a/util.c b/util.c index 63000b57..8e9d1d0c 100644 --- a/util.c +++ b/util.c @@ -34,7 +34,7 @@ #include "defs.h" #include #include -#if HAVE_SYS_XATTR_H +#ifdef HAVE_SYS_XATTR_H # include #endif #include @@ -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]; -- 2.40.0