From: Zbigniew Jędrzejewski-Szmek Date: Wed, 29 May 2024 10:51:08 +0000 (+0200) Subject: basic/fd-util: drop unnecessary {} X-Git-Tag: v257-rc1~1189^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4199866ac5de13ff261b1a490bd77a68510a9d72;p=thirdparty%2Fsystemd.git basic/fd-util: drop unnecessary {} --- diff --git a/src/basic/fd-util.c b/src/basic/fd-util.c index da4ee63add8..f9cac3d99e9 100644 --- a/src/basic/fd-util.c +++ b/src/basic/fd-util.c @@ -764,8 +764,7 @@ int rearrange_stdio(int original_input_fd, int original_output_fd, int original_ } /* Let's assemble fd[] with the fds to install in place of stdin/stdout/stderr */ - for (int i = 0; i < 3; i++) { - + for (int i = 0; i < 3; i++) if (fd[i] < 0) fd[i] = null_fd; /* A negative parameter means: connect this one to /dev/null */ else if (fd[i] != i && fd[i] < 3) { @@ -778,20 +777,16 @@ int rearrange_stdio(int original_input_fd, int original_output_fd, int original_ fd[i] = copy_fd[i]; } - } /* At this point we now have the fds to use in fd[], and they are all above the stdio range, so that * we have freedom to move them around. If the fds already were at the right places then the specific * fds are -EBADF. Let's now move them to the right places. This is the point of no return. */ - for (int i = 0; i < 3; i++) { - + for (int i = 0; i < 3; i++) if (fd[i] == i) { - /* fd is already in place, but let's make sure O_CLOEXEC is off */ r = fd_cloexec(i, false); if (r < 0) goto finish; - } else { assert(fd[i] > 2); @@ -800,7 +795,6 @@ int rearrange_stdio(int original_input_fd, int original_output_fd, int original_ goto finish; } } - } r = 0;