Skip to content
Permalink
Browse files
Windows : remove freopen(), "to keep fd = 0 busy".
a) We do not need this on Windows, and it is not clear what it does,inside
service.

b) It hinders debugging.
mysql-test-run.pl --debugger=vsjitdebugger more often than , would stop here
throwing "invalid handle" exception.
  • Loading branch information
vaintroub committed Feb 20, 2018
1 parent c3a3b77 commit 56d6776
Showing 1 changed file with 3 additions and 1 deletion.
@@ -5871,12 +5871,14 @@ int mysqld_main(int argc, char **argv)
mysqld_port,
MYSQL_COMPILATION_COMMENT);

#ifndef _WIN32
// try to keep fd=0 busy
if (!freopen(IF_WIN("NUL","/dev/null"), "r", stdin))
if (!freopen("/dev/null", "r", stdin))
{
// fall back on failure
fclose(stdin);
}
#endif

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

0 comments on commit 56d6776

Please sign in to comment.