Skip to content

Commit

Permalink
Windows : remove freopen(), "to keep fd = 0 busy".
Browse files Browse the repository at this point in the history
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.
4 changes: 3 additions & 1 deletion sql/mysqld.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 56d6776

Please sign in to comment.