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:
7051a96
)
Make toy_init() reentrant, or else xexec() has funky errors.
author
Rob Landley
<rob@landley.net>
Wed, 6 Jan 2010 11:29:17 +0000
(
05:29
-0600)
committer
Rob Landley
<rob@landley.net>
Wed, 6 Jan 2010 11:29:17 +0000
(
05:29
-0600)
main.c
patch
|
blob
|
history
diff --git
a/main.c
b/main.c
index
e0dab1c
..
4b4b376
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-76,10
+76,12
@@
void toy_init(struct toy_list *which, char *argv[])
if ((which->flags & TOYFLAG_NEEDROOT) && euid)
error_exit("Not root");
-
}
- // Free old toys contents here?
+ // Free old toys contents (to be reentrant)
+
+ if (toys.optargs != toys.argv+1) free(toys.optargs);
+ bzero(&toys, sizeof(struct toy_context));
toys.which = which;
toys.argv = argv;