Skip to content
Snippets Groups Projects
Commit 02d099a0 authored by Moe Jette's avatar Moe Jette
Browse files

Effectively handle NULL suspend/resume program names.

parent 37d64e6a
No related branches found
No related tags found
No related merge requests found
......@@ -141,7 +141,7 @@ static void _do_power_work(void)
bit_set(wake_node_bitmap, i);
}
if ((susp_state == 0)
&& (resume_rate == 0) || (resume_cnt <= resume_rate))
&& ((resume_rate == 0) || (resume_cnt <= resume_rate))
&& (base_state == NODE_STATE_IDLE)
&& (node_ptr->last_idle < (now - idle_time))
&& ((exc_node_bitmap == NULL) ||
......@@ -258,6 +258,9 @@ static pid_t _run_prog(char *prog, char *arg)
char program[1024], arg0[1024], arg1[1024], *pname;
pid_t child;
if (prog == NULL) /* disabled, useful for testing */
return -1;
strncpy(program, prog, sizeof(program));
pname = strrchr(program, '/');
if (pname == NULL)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment