projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
95842fb
)
taskset: (1ull < 65) like ops are not good, avoid that
author
Denis Vlasenko
<vda.linux@googlemail.com>
Fri, 25 Apr 2008 17:01:06 +0000
(17:01 -0000)
committer
Denis Vlasenko
<vda.linux@googlemail.com>
Fri, 25 Apr 2008 17:01:06 +0000
(17:01 -0000)
miscutils/taskset.c
patch
|
blob
|
history
diff --git
a/miscutils/taskset.c
b/miscutils/taskset.c
index 4815b6a76e274f20d43b19e9b9bcbe7790c94ba2..708abd9f275ac29c9d5fd30e1eb398683d4c8935 100644
(file)
--- a/
miscutils/taskset.c
+++ b/
miscutils/taskset.c
@@
-93,8
+93,10
@@
int taskset_main(int argc ATTRIBUTE_UNUSED, char **argv)
unsigned i;
/* Do not allow zero mask: */
unsigned long long m = xstrtoull_range(aff, 0, 1, ULLONG_MAX);
+ enum { CNT_BIT = CPU_SETSIZE < sizeof(m)*8 ? CPU_SETSIZE : sizeof(m)*8 };
+
CPU_ZERO(&mask);
- for (i = 0; i < C
PU_SETSIZE
; i++) {
+ for (i = 0; i < C
NT_BIT
; i++) {
unsigned long long bit = (1ULL << i);
if (bit & m)
CPU_SET(i, &mask);