comparison toys/other/taskset.c @ 955:144d5ba7d410

Replace users of xexec(toys.optargs) with xexec_optargs(0) to avoid free/reuse bug during argument parsing.
author Rob Landley <rob@landley.net>
date Thu, 18 Jul 2013 18:20:03 -0500
parents 7e0cea8fbc3e
children cbb1aca81eca
comparison
equal deleted inserted replaced
954:1cf9c28012a7 955:144d5ba7d410
88 void taskset_main(void) 88 void taskset_main(void)
89 { 89 {
90 if (!(toys.optflags & FLAG_p)) { 90 if (!(toys.optflags & FLAG_p)) {
91 if (toys.optc < 2) error_exit("Needs 2 args"); 91 if (toys.optc < 2) error_exit("Needs 2 args");
92 do_taskset(getpid(), 1); 92 do_taskset(getpid(), 1);
93 xexec(toys.optargs+1); 93 xexec_optargs(1);
94 } else { 94 } else {
95 char *c; 95 char *c;
96 pid_t pid = strtol(toys.optargs[toys.optc-1], &c, 10); 96 pid_t pid = strtol(toys.optargs[toys.optc-1], &c, 10);
97 97
98 if (*c) error_exit("Not int %s", toys.optargs[1]); 98 if (*c) error_exit("Not int %s", toys.optargs[1]);