diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-09-29 09:38:50 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-09-29 09:38:50 -0400 |
commit | 0a985af072812354742159777bea87777577889c (patch) | |
tree | 6936a7db02c2d1ad10763723b2b6f91c7686ca55 /src/test/test_util.c | |
parent | b827a08284230bb1a08ddd7eff258d2b690d6793 (diff) | |
download | tor-0a985af072812354742159777bea87777577889c.tar.gz tor-0a985af072812354742159777bea87777577889c.zip |
Parenthesize macro arguments for 13291 fix
Diffstat (limited to 'src/test/test_util.c')
-rw-r--r-- | src/test/test_util.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c index 7acda6bae7..693cc06e82 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -2853,7 +2853,7 @@ test_util_fgets_eagain(void *ptr) #ifdef _WIN32 /* I've assumed Windows doesn't have the gap between fork and exec * that causes the race condition on unix-like platforms */ -#define MATCH_PROCESS_STATUS(s1,s2) (s1 == s2) +#define MATCH_PROCESS_STATUS(s1,s2) ((s1) == (s2)) #else /* work around a race condition of the timing of SIGCHLD handler updates @@ -2863,14 +2863,14 @@ test_util_fgets_eagain(void *ptr) * PROCESS_STATUS_ERROR (and similarly with *_OR_NOTRUNNING) */ #define PROCESS_STATUS_RUNNING_OR_NOTRUNNING (PROCESS_STATUS_RUNNING+1) #define IS_RUNNING_OR_NOTRUNNING(s) \ - (s == PROCESS_STATUS_RUNNING || s == PROCESS_STATUS_NOTRUNNING) + ((s) == PROCESS_STATUS_RUNNING || (s) == PROCESS_STATUS_NOTRUNNING) /* well, this is ugly */ #define MATCH_PROCESS_STATUS(s1,s2) \ - ( s1 == s2 \ - ||(s1 == PROCESS_STATUS_RUNNING_OR_NOTRUNNING \ - && IS_RUNNING_OR_NOTRUNNING(s2)) \ - ||(s2 == PROCESS_STATUS_RUNNING_OR_NOTRUNNING \ - && IS_RUNNING_OR_NOTRUNNING(s1))) + ( (s1) == (s2) \ + ||((s1) == PROCESS_STATUS_RUNNING_OR_NOTRUNNING \ + && IS_RUNNING_OR_NOTRUNNING(s2)) \ + ||((s2) == PROCESS_STATUS_RUNNING_OR_NOTRUNNING \ + && IS_RUNNING_OR_NOTRUNNING(s1))) #endif // _WIN32 |