aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-11-16 00:35:46 -0600
committerRob Landley <rob@landley.net>2012-11-16 00:35:46 -0600
commitcaf39c26827f355c4e107f55c5c51f67c484bfd7 (patch)
tree718852f37b7143cb63e6e8838093993b19391a39 /main.c
parent02261e8082b9b098b20a4291fc2583f3c41db8d2 (diff)
downloadtoybox-caf39c26827f355c4e107f55c5c51f67c484bfd7.tar.gz
Add rebound support to intercept error_exit() and longjmp instead.
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.c b/main.c
index c705d645..7fb543ab 100644
--- a/main.c
+++ b/main.c
@@ -76,10 +76,10 @@ void toy_init(struct toy_list *which, char *argv[])
if ((which->flags & TOYFLAG_NEEDROOT) && euid) error_exit("Not root");
}
- // Free old toys contents (to be reentrant)
+ // Free old toys contents (to be reentrant), but leave rebound if any
if (toys.optargs != toys.argv+1) free(toys.optargs);
- memset(&toys, 0, sizeof(struct toy_context));
+ memset(&toys, 0, offsetof(struct toy_context, rebound));
toys.which = which;
toys.argv = argv;