aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2023-11-28 10:54:43 -0800
committerTony Luck <tony.luck@intel.com>2023-11-28 10:54:43 -0800
commit8dc95f46b47543cc1fa887d879f297f9fd01450c (patch)
tree2742a80ab60f847c1ad53cf04db10ff6d4ff4714
parentf230628f5aeb00987d640c3240be9582fc8e6000 (diff)
downloadras-tools-master.tar.gz
proc_cpuinfo: Fix bit shift for socket bitmaskHEADmaster
If there are more than 32 sockets "1 << s" doesn't work. Use "1L << s" Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r--proc_cpuinfo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/proc_cpuinfo.c b/proc_cpuinfo.c
index 842cabf..b8959ef 100644
--- a/proc_cpuinfo.c
+++ b/proc_cpuinfo.c
@@ -52,7 +52,7 @@ void proc_cpuinfo(int *nsockets, int *ncpus, char *model, int *modelnum, int **a
fprintf(stderr, "Found socket %d > max supported\n", s);
exit(1);
}
- sockmask |= 1 << s;
+ sockmask |= 1L << s;
} else if (strncmp(line, "processor", 9) == 0) {
p = strchr(&line[8], ':');
lcpu = strtol(p+1, NULL, 10);