diff options
-rw-r--r-- | error.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -429,8 +429,9 @@ bug_report_file(const char *file, int line) if ((ssize_t)fwrite(buf, 1, len, out) == (ssize_t)len || (ssize_t)fwrite(buf, 1, len, (out = stdout)) == (ssize_t)len) { - return out; + return out; } + return NULL; } @@ -519,6 +520,17 @@ bug_report_begin_valist(FILE *out, const char *fmt, va_list args) snprintf(buf, sizeof(buf), "\n%s\n\n", ruby_description); fputs(buf, out); preface_dump(out); + +#if RUBY_DEVEL + const char *cmd = getenv("RUBY_ON_BUG"); + if (cmd) { + snprintf(buf, sizeof(buf), "%s %d", cmd, getpid()); + int r = system(buf); + if (r == -1) { + snprintf(buf, sizeof(buf), "Launching RUBY_ON_BUG command failed."); + } + } +#endif } #define bug_report_begin(out, fmt) do { \ |