From: Rob Landley Date: Thu, 30 Apr 2015 20:11:34 +0000 (-0500) Subject: Add default sigpipe handler for android (as suggested by Elliott Hughes). X-Git-Tag: android-x86-6.0-r1~58^2~202 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e7c09548b9c6188857260064c8ceba03d850c4b7;p=android-x86%2Fexternal-toybox.git Add default sigpipe handler for android (as suggested by Elliott Hughes). --- diff --git a/main.c b/main.c index 57022442..2fd22d4b 100644 --- a/main.c +++ b/main.c @@ -183,8 +183,17 @@ void toybox_main(void) xputc('\n'); } +static void shutup_sigpipe(int i) +{ + // exit success from sigpipe to mollify overzealous crash reporting. + _exit(0); +} + int main(int argc, char *argv[]) { + if (CFG_TOYBOX_ON_ANDROID) signal(SIGPIPE, shutup_sigpipe); + else signal(SIGPIPE, SIG_IGN); + if (CFG_TOYBOX) { // Trim path off of command name *argv = basename(*argv);