Skip to content
Snippets Groups Projects
Commit 0e4c6dfa authored by Ilya's avatar Ilya Committed by Konstantin Osipov
Browse files

Fix truncated output on Mac OS

In case of default log output
flag o_NONBLOCK is not set to descriptor
parent 84e8acdb
No related merge requests found
......@@ -310,7 +310,13 @@ say_logger_init(const char *init_str, int level, int nonblock, int background)
say_file_init(init_str);
break;
}
}
if (nonblock) {
int flags;
if ( (flags = fcntl(log_fd, F_GETFL, 0)) < 0 ||
fcntl(log_fd, F_SETFL, flags | O_NONBLOCK) < 0)
say_syserror("fcntl, fd=%i", log_fd);
}
}
if (background) {
fflush(stderr);
......@@ -327,12 +333,6 @@ say_logger_init(const char *init_str, int level, int nonblock, int background)
dup2(log_fd, STDOUT_FILENO);
}
}
if (nonblock) {
int flags;
if ( (flags = fcntl(log_fd, F_GETFL, 0)) < 0 ||
fcntl(log_fd, F_SETFL, flags | O_NONBLOCK) < 0)
say_syserror("fcntl, fd=%i", log_fd);
}
booting = false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment