path: root/thread_pthread.c
diff options
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-05 06:56:09 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-05 06:56:09 (GMT)
commit2311087b685e8dc0f21f4a89875f25c22f5c39a9 (patch)
tree792280e5d4b99cb7ed77c7b8d742ef73fb4f6300 /thread_pthread.c
parentbd9bc1dbe51b93db0447ab06b68761fa4b3768e6 (diff)
Tiny Fix for ASYNC BUG error message copying
The previous logic would overwrite the error message, replacing the message with the `fd` number. This tiny update will print the message in full. (I'm trying to debug an issue with the timer thread on my machine and the lack of error messages makes it really hard). [Fix GH-1829] From: Bo <> git-svn-id: svn+ssh:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index a05f8a5..951885f 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -1212,7 +1212,7 @@ async_bug_fd(const char *mesg, int errno_arg, int fd)
char buff[64];
size_t n = strlcpy(buff, mesg, sizeof(buff));
if (n < sizeof(buff)-3) {
- ruby_snprintf(buff, sizeof(buff)-n, "(%d)", fd);
+ ruby_snprintf(buff+n, sizeof(buff)-n, "(%d)", fd);
rb_async_bug_errno(buff, errno_arg);