From 0bda28c4634541f90cd72638395ac62636555ec2 Mon Sep 17 00:00:00 2001 From: verycosy Date: Mon, 10 Feb 2025 20:49:51 +0900 Subject: [PATCH] unix: fix code style --- src/unix/process.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/unix/process.c b/src/unix/process.c index aab8cdea..43e6b798 100644 --- a/src/unix/process.c +++ b/src/unix/process.c @@ -189,10 +189,11 @@ static int uv__process_init_stdio(uv_stdio_container_t* container, int fds[2]) { int mask; int fd; int ret; - int size = 64 * 1024; + int size; int i; mask = UV_IGNORE | UV_CREATE_PIPE | UV_INHERIT_FD | UV_INHERIT_STREAM; + size = 64 * 1024; switch (container->flags & mask) { case UV_IGNORE: @@ -205,15 +206,15 @@ static int uv__process_init_stdio(uv_stdio_container_t* container, int fds[2]) { else { ret = uv_socketpair(SOCK_STREAM, 0, fds, 0, 0); - if (ret == 0) - for (i = 0; i < 2; i++) { - setsockopt(fds[i], SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)); - setsockopt(fds[i], SOL_SOCKET, SO_SNDBUF, &size, sizeof(size)); - } - - return ret; + if (ret == 0) + for (i = 0; i < 2; i++) { + setsockopt(fds[i], SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)); + setsockopt(fds[i], SOL_SOCKET, SO_SNDBUF, &size, sizeof(size)); + } } + return ret; + case UV_INHERIT_FD: case UV_INHERIT_STREAM: if (container->flags & UV_INHERIT_FD)