OSDN Git Service
(root)
/
android-x86
/
external-toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb7ed52
)
Add default sigpipe handler for android (as suggested by Elliott Hughes).
author
Rob Landley
<rob@landley.net>
Thu, 30 Apr 2015 20:11:34 +0000
(15:11 -0500)
committer
Rob Landley
<rob@landley.net>
Thu, 30 Apr 2015 20:11:34 +0000
(15:11 -0500)
main.c
patch
|
blob
|
history
diff --git
a/main.c
b/main.c
index
5702244
..
2fd22d4
100644
(file)
--- 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);