Skip to content

Commit bb10c5d

Browse files
committed
stress-sigpipe: rework nested if statements into 1 if statement
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
1 parent c6f570a commit bb10c5d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

stress-sigpipe.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,8 @@ static int stress_sigpipe(stress_args_t *args)
7171

7272
/* cause SIGPIPE if pipe closed */
7373
ret = write(pipefds[1], &data, sizeof(data));
74-
if (LIKELY(ret < 0)) {
75-
if (errno == EPIPE)
76-
epipe_count++;
77-
}
74+
if (LIKELY(ret < 0) && (errno == EPIPE))
75+
epipe_count++;
7876
} while (stress_continue(args));
7977

8078
stress_proc_state_set(args->name, STRESS_STATE_DEINIT);

0 commit comments

Comments
 (0)