From: Daniel Stodden Date: Mon, 25 Mar 2013 09:33:59 +0000 (-0700) Subject: schedutils: don't apply -a without -p X-Git-Tag: v2.23-rc2~115 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d9b22d179a274013dd1eb29c7b9ab5225bfd7d70;p=thirdparty%2Futil-linux.git schedutils: don't apply -a without -p The unsuspecting user might use taskset -a mask command. Behavior then is to exec with no affinity applied at all. Better handled by ignoring all_tasks if no pid was given. Signed-off-by: Daniel Stodden --- diff --git a/schedutils/taskset.c b/schedutils/taskset.c index aba0b6f9ee..c2b9ab6f67 100644 --- a/schedutils/taskset.c +++ b/schedutils/taskset.c @@ -217,7 +217,7 @@ int main(int argc, char **argv) argv[optind]); } - if (all_tasks) { + if (all_tasks && pid) { struct proc_tasks *tasks = proc_open_tasks(pid); while (!proc_next_tid(tasks, &ts.pid)) do_taskset(&ts, new_setsize, new_set);