- rc = snprintf(port, sizeof port, "%cp", SUBST_CHAR);
- if (rc < 0 || rc >= (int)(sizeof port)) {
- ERROR("port->txt failed");
- }
- else {
- /* instantiate arguments and environment */
- if (json_object_object_get_ex(main_config, "token", &otok))
- token = json_object_get_string(otok);
- else
- token = SUBST_STR"p";
- args = instanciate_command_args(exec, port, token);
- if (args && instanciate_environ(port, token) >= 0) {
- /* run */
- if (!SELF_PGROUP)
- setpgid(0, 0);
- execv(args[0], args);
- ERROR("can't launch %s: %m", args[0]);
- }
+ port = 0;
+ /* instantiate arguments and environment */
+ if (json_object_object_get_ex(main_config, "token", &otok))
+ token = json_object_get_string(otok);
+ else
+ token = 0;
+ args = instanciate_command_args(exec, port, token);
+ if (args && instanciate_environ(port, token) >= 0) {
+ /* run */
+ if (!SELF_PGROUP)
+ setpgid(0, 0);
+ execv(args[0], args);
+ ERROR("can't launch %s: %m", args[0]);