diff options
author | neal <neal> | 2008-07-08 14:07:56 +0000 |
---|---|---|
committer | neal <neal> | 2008-07-08 14:07:56 +0000 |
commit | 6df49ca1a377b5d0e70682ba7118076af2cc801a (patch) | |
tree | 77edd358a230872900340357680c15f50d3f3082 /hieronymus/hieronymus.c | |
parent | 062419af3894fc9be7accfc0ec9bd223edf61bd3 (diff) |
hieronymus/
2008-07-08 Neal H. Walfield <neal@gnu.org>
* Makefile.am (modules.h): Generate an array of arguments from
each module's command line.
(ruth_commandline): Don't quote arguments.
* hieronymus.c (struct module): Remove field commandline, replace
with args.
(main): Create the argument vector based on the MODULES[I].ARGS.
libc-parts/
2008-07-08 Neal H. Walfield <neal@gnu.org>
* process-spawn.c (process_spawn): Don't add an extra trailing NUL
to the argment vector or the environment vector.
* ia32-cmain.c (finish): Assume the command line is in argz
format and parse it appropriately.
Diffstat (limited to 'hieronymus/hieronymus.c')
-rw-r--r-- | hieronymus/hieronymus.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/hieronymus/hieronymus.c b/hieronymus/hieronymus.c index 55f424b..0727d45 100644 --- a/hieronymus/hieronymus.c +++ b/hieronymus/hieronymus.c @@ -43,7 +43,8 @@ struct module int weight; /* Delay in seconds. */ unsigned int delay; - const char *commandline; + /* Maximum of 8 arguments. */ + const char *args[8]; char *start; char *end; @@ -242,7 +243,18 @@ main (int argc, char *argv[]) panic ("Binary %s corrupted!", modules[i].name); } - const char *argv[] = { modules[i].name, modules[i].commandline, NULL }; + const char *argv[1 + (sizeof (modules[i].args) + / sizeof (modules[i].args[0])) + + 1]; + argv[0] = modules[i].name; + int j; + for (j = 0; + j < (sizeof (modules[i].args) / sizeof (modules[i].args[0])) + && modules[i].args[j]; + j ++) + argv[1 + j] = modules[i].args[j]; + argv[1 + j] = NULL; + const char *env[] = { NULL }; thread[i] = process_spawn (activities[i], modules[i].start, modules[i].end, |