svn commit: trunk/busybox/miscutils
vda at busybox.net
vda at busybox.net
Fri Apr 25 17:01:06 UTC 2008
Author: vda
Date: 2008-04-25 10:01:06 -0700 (Fri, 25 Apr 2008)
New Revision: 21864
Log:
taskset: (1ull < 65) like ops are not good, avoid that
Modified:
trunk/busybox/miscutils/taskset.c
Changeset:
Modified: trunk/busybox/miscutils/taskset.c
===================================================================
--- trunk/busybox/miscutils/taskset.c 2008-04-25 16:51:30 UTC (rev 21863)
+++ trunk/busybox/miscutils/taskset.c 2008-04-25 17:01:06 UTC (rev 21864)
@@ -93,8 +93,10 @@
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 < CPU_SETSIZE; i++) {
+ for (i = 0; i < CNT_BIT; i++) {
unsigned long long bit = (1ULL << i);
if (bit & m)
CPU_SET(i, &mask);
More information about the busybox-cvs
mailing list