Skip to content

Commit 56d6776

Browse files
committed
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.
1 parent c3a3b77 commit 56d6776

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sql/mysqld.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5871,12 +5871,14 @@ int mysqld_main(int argc, char **argv)
58715871
mysqld_port,
58725872
MYSQL_COMPILATION_COMMENT);
58735873

5874+
#ifndef _WIN32
58745875
// try to keep fd=0 busy
5875-
if (!freopen(IF_WIN("NUL","/dev/null"), "r", stdin))
5876+
if (!freopen("/dev/null", "r", stdin))
58765877
{
58775878
// fall back on failure
58785879
fclose(stdin);
58795880
}
5881+
#endif
58805882

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

0 commit comments

Comments
 (0)