From bf62e02420efc450c42c5c00916f59ccd8694f11 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 9 Apr 2004 21:02:43 +0000 Subject: [PATCH] fix crash notification not being displayed if stdout has been closed --- stepmania/src/archutils/Unix/CrashHandlerChild.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/stepmania/src/archutils/Unix/CrashHandlerChild.cpp b/stepmania/src/archutils/Unix/CrashHandlerChild.cpp index dae7a49f0a..3869b9eb54 100644 --- a/stepmania/src/archutils/Unix/CrashHandlerChild.cpp +++ b/stepmania/src/archutils/Unix/CrashHandlerChild.cpp @@ -349,7 +349,13 @@ static void child_process() /* Forcibly kill our parent. */ kill( getppid(), SIGKILL ); #else - fprintf(stderr, + /* stdout may have been inadvertently closed by the crash in the parent; + * write to /dev/tty instead. */ + FILE *tty = fopen( "/dev/tty", "w" ); + if( tty == NULL ) + tty = stdin; + + fprintf(tty, "\n" PRODUCT_NAME " has crashed. Debug information has been output to\n" "\n"