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.
This commit is contained in:
Vladislav Vaintroub 2018-02-20 20:03:23 +00:00
parent c3a3b77f9a
commit 56d6776524

View file

@ -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();