From 534c5ec919393259fd13c896f7552edf03538e1a 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 4efc281..5da71ce 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]); -- 2.7.4