2011-01-04 21:13:38 +00:00
|
|
|
diff -up numactl-2.0.6/libnuma.c.orig numactl-2.0.6/libnuma.c
|
|
|
|
--- numactl-2.0.6/libnuma.c.orig 2010-12-29 08:23:11.000000000 -0500
|
|
|
|
+++ numactl-2.0.6/libnuma.c 2011-01-04 16:10:58.514024338 -0500
|
|
|
|
@@ -1263,9 +1263,10 @@ numa_node_to_cpus_v1(int node, unsigned
|
2009-06-17 17:17:18 +00:00
|
|
|
sprintf(fn, "/sys/devices/system/node/node%d/cpumap", node);
|
|
|
|
f = fopen(fn, "r");
|
|
|
|
if (!f || getdelim(&line, &len, '\n', f) < 1) {
|
|
|
|
- numa_warn(W_nosysfs2,
|
|
|
|
- "/sys not mounted or invalid. Assuming one node: %s",
|
|
|
|
- strerror(errno));
|
|
|
|
+ if (f)
|
|
|
|
+ numa_warn(W_nosysfs2,
|
|
|
|
+ "/sys not mounted or invalid. Assuming one node: %s",
|
|
|
|
+ strerror(errno));
|
|
|
|
bitmask.maskp = (unsigned long *)mask;
|
|
|
|
bitmask.size = buflen_needed * 8;
|
|
|
|
numa_bitmask_setall(&bitmask);
|
2011-01-04 21:13:38 +00:00
|
|
|
@@ -1341,13 +1342,15 @@ numa_node_to_cpus_v2(int node, struct bi
|
2009-06-17 17:17:18 +00:00
|
|
|
sprintf(fn, "/sys/devices/system/node/node%d/cpumap", node);
|
|
|
|
f = fopen(fn, "r");
|
|
|
|
if (!f || getdelim(&line, &len, '\n', f) < 1) {
|
|
|
|
- numa_warn(W_nosysfs2,
|
|
|
|
- "/sys not mounted or invalid. Assuming one node: %s",
|
|
|
|
- strerror(errno));
|
2011-01-04 21:13:38 +00:00
|
|
|
- numa_warn(W_nosysfs2,
|
|
|
|
- "(cannot open or correctly parse %s)", fn);
|
|
|
|
- numa_bitmask_setall(mask);
|
|
|
|
- err = -1;
|
|
|
|
+ if (f) {
|
2009-06-17 17:17:18 +00:00
|
|
|
+ numa_warn(W_nosysfs2,
|
|
|
|
+ "/sys not mounted or invalid. Assuming one node: %s",
|
|
|
|
+ strerror(errno));
|
2011-01-04 21:13:38 +00:00
|
|
|
+ numa_warn(W_nosysfs2,
|
|
|
|
+ "(cannot open or correctly parse %s)", fn);
|
|
|
|
+ numa_bitmask_setall(mask);
|
|
|
|
+ err = -1;
|
|
|
|
+ }
|
2009-06-17 17:17:18 +00:00
|
|
|
}
|
2011-01-04 21:13:38 +00:00
|
|
|
if (f)
|
|
|
|
fclose(f);
|