diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-08-30 00:25:03 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-08-30 00:25:03 +0200 |
commit | 2dcfb6a35862817c529229cd9d73ac89815ea662 (patch) | |
tree | 65c6448a1bd4a476780f2de6f82240e793f8c86d /libdiskfs | |
parent | 11efcafb3372777ee3e416c145047707d9d228dd (diff) | |
download | hurd-2dcfb6a35862817c529229cd9d73ac89815ea662.tar.gz hurd-2dcfb6a35862817c529229cd9d73ac89815ea662.tar.bz2 hurd-2dcfb6a35862817c529229cd9d73ac89815ea662.zip |
libdiskfs: Avoid crashing when stdout/err shuts down
stdout/err could shut down for whatever reason (killed the term on
/dev/console or whatever). We should not crash just because we lost our
ability to print output.
Diffstat (limited to 'libdiskfs')
-rw-r--r-- | libdiskfs/console.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libdiskfs/console.c b/libdiskfs/console.c index 74715b8b..1698f633 100644 --- a/libdiskfs/console.c +++ b/libdiskfs/console.c @@ -68,4 +68,8 @@ diskfs_console_stdio () stdout = stderr = mach_open_devstream (cons, "w"); mach_port_deallocate (mach_task_self (), cons); } + + /* And make sure we don't die just because we got some error there. */ + signal (SIGPIPE, SIG_IGN); + signal (SIGLOST, SIG_IGN); } |