summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_common_syscalls.inc
diff options
context:
space:
mode:
authorAndy Gibbs <andyg1001@hotmail.co.uk>2013-04-16 15:18:55 +0000
committerAndy Gibbs <andyg1001@hotmail.co.uk>2013-04-16 15:18:55 +0000
commit102c04325b454957c322f61c5a8033b720bc9238 (patch)
treeaefc6840f3f1a973884a0b871cd44095a93c4e1b /lib/sanitizer_common/sanitizer_common_syscalls.inc
parent3f5528b4112a6e63d4535c1804bee4ba310879e7 (diff)
Wrap macro invocations in braces to supress 'suggest braces around empty body in an ‘if’ statement' warning.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@179597 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_common_syscalls.inc')
-rw-r--r--lib/sanitizer_common/sanitizer_common_syscalls.inc30
1 files changed, 20 insertions, 10 deletions
diff --git a/lib/sanitizer_common/sanitizer_common_syscalls.inc b/lib/sanitizer_common/sanitizer_common_syscalls.inc
index 753f80fa1..a0de10414 100644
--- a/lib/sanitizer_common/sanitizer_common_syscalls.inc
+++ b/lib/sanitizer_common/sanitizer_common_syscalls.inc
@@ -74,23 +74,26 @@ PRE_SYSCALL(recvmsg)(int sockfd, struct sanitizer_kernel_msghdr *msg,
POST_SYSCALL(recvmsg)(long res, int sockfd, struct sanitizer_kernel_msghdr *msg,
int flags) {
if (res > 0)
- for (unsigned long i = 0; i < msg->msg_iovlen; ++i)
+ for (unsigned long i = 0; i < msg->msg_iovlen; ++i) {
POST_WRITE(msg->msg_iov[i].iov_base, msg->msg_iov[i].iov_len);
+ }
POST_WRITE(msg->msg_control, msg->msg_controllen);
}
PRE_SYSCALL(rt_sigpending)(void *p, unsigned long s) { PRE_WRITE(p, s); }
POST_SYSCALL(rt_sigpending)(long res, void *p, unsigned long s) {
- if (res == 0)
+ if (res == 0) {
POST_WRITE(p, s);
+ }
}
PRE_SYSCALL(getdents)(int fd, void *dirp, int count) { PRE_WRITE(dirp, count); }
POST_SYSCALL(getdents)(long res, int fd, void *dirp, int count) {
- if (res > 0)
+ if (res > 0) {
POST_WRITE(dirp, res);
+ }
}
PRE_SYSCALL(getdents64)(int fd, void *dirp, int count) {
@@ -98,36 +101,43 @@ PRE_SYSCALL(getdents64)(int fd, void *dirp, int count) {
}
POST_SYSCALL(getdents64)(long res, int fd, void *dirp, int count) {
- if (res > 0)
+ if (res > 0) {
POST_WRITE(dirp, res);
+ }
}
PRE_SYSCALL(wait4)(int pid, int *status, int options,
struct sanitizer_kernel_rusage *r) {
- if (status)
+ if (status) {
PRE_WRITE(status, sizeof(*status));
- if (r)
+ }
+ if (r) {
PRE_WRITE(r, sizeof(*r));
+ }
}
POST_SYSCALL(wait4)(long res, int pid, int *status, int options,
struct sanitizer_kernel_rusage *r) {
if (res > 0) {
- if (status)
+ if (status) {
POST_WRITE(status, sizeof(*status));
- if (r)
+ }
+ if (r) {
POST_WRITE(r, sizeof(*r));
+ }
}
}
PRE_SYSCALL(waitpid)(int pid, int *status, int options) {
- if (status)
+ if (status) {
PRE_WRITE(status, sizeof(*status));
+ }
}
POST_SYSCALL(waitpid)(long res, int pid, int *status, int options) {
- if (res > 0 && status)
+ if (res > 0 && status) {
POST_WRITE(status, sizeof(*status));
+ }
}
} // extern "C"