From 4471c77905f8dae39c6b5569a724f1368293c646 Mon Sep 17 00:00:00 2001 From: Zhang Xianyi Date: Fri, 26 Jul 2013 23:43:54 +0800 Subject: [PATCH] Fixed #261. Use strncmp instead of a comparing trick. --- driver/others/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/driver/others/init.c b/driver/others/init.c index 4efc2816a..5da71cec1 100644 --- a/driver/others/init.c +++ b/driver/others/init.c @@ -83,6 +83,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #define MAX_NODES 16 #define MAX_CPUS 256 @@ -315,7 +316,7 @@ static int numa_check(void) { } while ((dir = readdir(dp)) != NULL) { - if (*(unsigned int *) dir -> d_name == 0x065646f6eU) { + if (strncmp(dir->d_name, "node", 4)==0) { node = atoi(&dir -> d_name[4]);