diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-07-14 15:30:27 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-07-15 08:44:14 +0200 |
commit | 0375f2e2730c6e30f3e6f171c9b73d8553a3ae9a (patch) | |
tree | ff3b9906554c87066b47270876b370bbc92de74f /mysys | |
parent | 7338d3f221e33042dfcf5c1a245317aa7cb015a7 (diff) | |
download | mariadb-git-0375f2e2730c6e30f3e6f171c9b73d8553a3ae9a.tar.gz |
MDEV-12144 Signal 6 crash corrupts ibd files
Avoid using STDERR_FILENO. The server uses freopen(stderr),
so stderr can be on any file descriptor.
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/my_fopen.c | 2 | ||||
-rw-r--r-- | mysys/stacktrace.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c index 99a9035c0c2..9131a2549e0 100644 --- a/mysys/my_fopen.c +++ b/mysys/my_fopen.c @@ -143,7 +143,7 @@ static int no_close(void *cookie __attribute__((unused))) /* A hack around a race condition in the implementation of freopen. - The race condition steams from the fact that the current fd of + The race condition stems from the fact that the current fd of the stream is closed before its number is used to duplicate the new file descriptor. This defeats the desired atomicity of the close and duplicate of dup2(). diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c index 402520990b6..ae715c04621 100644 --- a/mysys/stacktrace.c +++ b/mysys/stacktrace.c @@ -744,7 +744,7 @@ void my_safe_print_str(const char *val, int len) size_t my_write_stderr(const void *buf, size_t count) { - return (size_t) write(STDERR_FILENO, buf, count); + return (size_t) write(fileno(stderr), buf, count); } |