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 <bo@bowild.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-03-05 06:56:09 +00:00
Родитель bd9bc1dbe5
Коммит 2311087b68
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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);
}