Skip to content
Permalink
Browse files
Post-fix after MDEV-8540 - do not close stdin on Windows.
It is not open.
  • Loading branch information
vaintroub committed Jul 2, 2018
1 parent 0897a25 commit 8c5d64d
Showing 1 changed file with 5 additions and 0 deletions.
@@ -5149,8 +5149,10 @@ int win_main(int argc, char **argv)
int mysqld_main(int argc, char **argv)
#endif
{
#ifndef _WIN32
/* We can't close stdin just now, because it may be booststrap mode. */
bool please_close_stdin= fcntl(STDIN_FILENO, F_GETFD) >= 0;
#endif

/*
Perform basic thread library and malloc initialization,
@@ -5495,9 +5497,12 @@ int mysqld_main(int argc, char **argv)
(char*) "" : mysqld_unix_port),
mysqld_port,
MYSQL_COMPILATION_COMMENT);
#ifndef _WIN32
/* Only close stdin if it was open initinally. */
if (please_close_stdin)
fclose(stdin);
#endif

#if defined(_WIN32) && !defined(EMBEDDED_LIBRARY)
Service.SetRunning();
#endif

0 comments on commit 8c5d64d

Please sign in to comment.