From 0890c8a403f60c2f66f17bf5d6bb16039b47c913 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 21 Aug 2011 00:10:45 +0200 Subject: [PATCH] Cosmetic improvement in ifdefs. No code changes * strace.c (proc_open): Change ifdefs so that braces are properly paired. Signed-off-by: Denys Vlasenko --- strace.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/strace.c b/strace.c index 7e59b083..e5973b41 100644 --- a/strace.c +++ b/strace.c @@ -1311,13 +1311,13 @@ proc_open(struct tcb *tcp, int attaching) set_cloexec_flag(tcp->pfd_as); #else /* Open the process pseudo-file in /proc. */ -#ifndef FREEBSD +# ifndef FREEBSD sprintf(proc, "/proc/%d", tcp->pid); tcp->pfd = open(proc, O_RDWR|O_EXCL); -#else /* FREEBSD */ +# else sprintf(proc, "/proc/%d/mem", tcp->pid); tcp->pfd = open(proc, O_RDWR); -#endif /* FREEBSD */ +# endif if (tcp->pfd < 0) { perror("strace: open(\"/proc/...\", ...)"); return -1; @@ -1495,10 +1495,11 @@ proc_open(struct tcb *tcp, int attaching) /* Set it running: maybe execve will be next. */ #ifndef FREEBSD arg = 0; - if (IOCTL(tcp->pfd, PIOCRUN, &arg) < 0) { -#else /* FREEBSD */ - if (IOCTL(tcp->pfd, PIOCRUN, 0) < 0) { -#endif /* FREEBSD */ + if (IOCTL(tcp->pfd, PIOCRUN, &arg) < 0) +#else + if (IOCTL(tcp->pfd, PIOCRUN, 0) < 0) +#endif + { perror("PIOCRUN"); return -1; } @@ -1510,10 +1511,9 @@ proc_open(struct tcb *tcp, int attaching) kill(tcp->pid, SIGCONT); #endif } -#ifndef FREEBSD } -#else /* FREEBSD */ - } else { +#ifdef FREEBSD + else { if (attaching < 2) { /* We are attaching to an already running process. * Try to figure out the state of the process in syscalls, -- 2.40.0