Make cpusetobj_strprint() prepare the string in order to print the

least significant cpuset_t word at the outmost right part of the string
(more far from the beginning of it).  This follows the natural build of
bits rappresentation in the words.
This commit is contained in:
Attilio Rao 2011-05-22 20:29:47 +00:00
parent d30e0db53a
commit 34a1e065bd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/largeSMP/; revision=222195

View File

@ -650,12 +650,12 @@ cpusetobj_strprint(char *buf, const cpuset_t *set)
bytesp = 0;
bufsiz = CPUSETBUFSIZ;
for (i = 0; i < (_NCPUWORDS - 1); i++) {
for (i = _NCPUWORDS - 1; i > 0; i--) {
bytesp = snprintf(tbuf, bufsiz, "%lx, ", set->__bits[i]);
bufsiz -= bytesp;
tbuf += bytesp;
}
snprintf(tbuf, bufsiz, "%lx", set->__bits[_NCPUWORDS - 1]);
snprintf(tbuf, bufsiz, "%lx", set->__bits[0]);
return (buf);
}