Skip to content

Commit

Permalink
MDEV-9466 : Exception handler on Windows does not output any text,
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
vaintroub committed Feb 2, 2016
1 parent 0e84d54 commit 603c096
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/my_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

/*
Expand Down

0 comments on commit 603c096

Please sign in to comment.