OSDN Git Service

Replace android-specific hack with just signal(SIGPIPE, SIG_IGN).
authorRob Landley <rob@landley.net>
Mon, 4 May 2015 01:18:53 +0000 (20:18 -0500)
committerRob Landley <rob@landley.net>
Mon, 4 May 2015 01:18:53 +0000 (20:18 -0500)
main.c

diff --git a/main.c b/main.c
index 2fd22d4..c557030 100644 (file)
--- a/main.c
+++ b/main.c
@@ -183,16 +183,10 @@ 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);
+  // We check our own stdout errors, disable sigpipe killer
+  signal(SIGPIPE, SIG_IGN);
 
   if (CFG_TOYBOX) {
     // Trim path off of command name