diff --git a/core/tarantool.m b/core/tarantool.m index 46a513a8c200b34260fcb874a145bf3d781dca0e..8ecdd33694dd1f6882478631142ca34cb2c59694 100644 --- a/core/tarantool.m +++ b/core/tarantool.m @@ -316,32 +316,32 @@ create_pid(void) fclose(f); } -/** Run in the background. - */ -static void background() +/** Run in the background. */ +static void +background() { - switch (fork()) { - case -1: - goto error; - case 0: /* child */ - break; - default: /* parent */ - exit(EXIT_SUCCESS); - } - - if (setsid() == -1) - goto error; - - /* - * Prints to stdout on failure, so got to be done before we - * close it. - */ - create_pid(); - - close(STDIN_FILENO); - close(STDOUT_FILENO); - close(STDERR_FILENO); + switch (fork()) { + case -1: + goto error; + case 0: /* child */ + break; + default: /* parent */ + exit(EXIT_SUCCESS); + } + + if (setsid() == -1) + goto error; + + /* + * Prints to stdout on failure, so got to be done before + * we close it. + */ + create_pid(); + close(STDIN_FILENO); + close(STDOUT_FILENO); + close(STDERR_FILENO); + return; error: exit(EXIT_FAILURE); }