- int code = 404;
- char *args = xstrdup(args_);
- char *save_ptr = NULL;
- char *option_name;
- char *option_val;
-
- option_name = strtok_r(args, " ", &save_ptr);
- option_val = strtok_r(NULL, " ", &save_ptr);
- if (option_val) {
- int i;
- for (i = 0; i < n_stress_options; i++) {
- struct stress_option *option = stress_options[i];
- if (!strcmp(option_name, option->name)) {
- unsigned int period = strtoul(option_val, NULL, 0);
- bool random = strstr(args_, "random");
-
- stress_set(option, period, random);
- code = 200;
- break;
- }
+ const char *option_name = argv[1];
+ const char *option_val = argv[2];
+ int i;
+
+ for (i = 0; i < n_stress_options; i++) {
+ struct stress_option *option = stress_options[i];
+ if (!strcmp(option_name, option->name)) {
+ unsigned int period = strtoul(option_val, NULL, 0);
+ bool random = !strcmp(argv[3], "random");
+
+ stress_set(option, period, random);
+ unixctl_command_reply(conn, NULL);
+ return;