From: Daniel Stodden <daniel.stodden@googlemail.com>
To: util-linux@vger.kernel.org
Cc: Daniel Stodden <daniel.stodden@gmail.com>
Subject: [PATCH] schedutils: don't apply -a without -p
Date: Mon, 25 Mar 2013 02:33:59 -0700 [thread overview]
Message-ID: <1364204039-18148-1-git-send-email-daniel.stodden@gmail.com> (raw)
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 <daniel.stodden@gmail.com>
---
schedutils/taskset.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/schedutils/taskset.c b/schedutils/taskset.c
index aba0b6f..c2b9ab6 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);
--
1.7.10.4
next reply other threads:[~2013-03-25 9:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-25 9:33 Daniel Stodden [this message]
2013-03-26 11:39 ` [PATCH] schedutils: don't apply -a without -p Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1364204039-18148-1-git-send-email-daniel.stodden@gmail.com \
--to=daniel.stodden@googlemail.com \
--cc=daniel.stodden@gmail.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox