MDEV-9466 : Exception handler on Windows does not output any text,

if mysqld runs as service

The bug is caused by the attempt to write to filedescriptor 2
(STDERR_FILENO), however in case of a service stderr has different fd
(debugging shows fileno(stderr) is 4 after freopen, and -1 before it)

Fixed definition of STDERR_FILENO for Windows to be fileno(stderr).
This commit is contained in:
Vladislav Vaintroub 2016-02-03 00:43:00 +01:00
commit 603c0960ba

View file

@ -436,7 +436,7 @@ extern "C" int madvise(void *addr, size_t len, int behav);
#endif
#ifndef STDERR_FILENO
#define STDERR_FILENO 2
#define STDERR_FILENO fileno(stderr)
#endif
/*