fix crash notification not being displayed if stdout has been closed
This commit is contained in:
@@ -349,7 +349,13 @@ static void child_process()
|
|||||||
/* Forcibly kill our parent. */
|
/* Forcibly kill our parent. */
|
||||||
kill( getppid(), SIGKILL );
|
kill( getppid(), SIGKILL );
|
||||||
#else
|
#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"
|
"\n"
|
||||||
PRODUCT_NAME " has crashed. Debug information has been output to\n"
|
PRODUCT_NAME " has crashed. Debug information has been output to\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user