]> granicus.if.org Git - strace/commitdiff
Consistenly use #ifdef to check for AC_DEFINE'd macros
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 17 Jun 2015 20:09:13 +0000 (20:09 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 17 Jun 2015 20:09:13 +0000 (20:09 +0000)
* 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
defs.h
net.c
printstat.h
syscall.c
util.c

diff --git a/aio.c b/aio.c
index 7d8fb65041830497f4c80ba0b844165deadedad1..e5905cbd5a50492cfe4b9298a817dcfdb87595a3 100644 (file)
--- 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 c02f8103945513c3b318a2dcd7b5fb8f856cb94b..7e0b94874dc9fa03615cbeec2726391d082c998c 100644 (file)
--- 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 aae04980146c4066a2eb584e97307a783ab90ea0..c570b7a1da3c8d856ee1893b2a9d79993eea0a75 100644 (file)
--- 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
index 53112feac0ea52fefebbed3c09ab8e27ba653a7c..033d4a0a8f9756173559adc40cd853744af5bd43 100644 (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("}");
index 23ed53fe2d5ff4a1903753f583281a43f53d5cdd..0d26b45c3f43a68ccc58c5e5dcc7af649506fe73 100644 (file)
--- 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 63000b5708bbda1464dc19e82ab3f519d53b8bd1..8e9d1d0cdf2090b8d4aaa74e8459ae9cf8da449e 100644 (file)
--- a/util.c
+++ b/util.c
@@ -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];