Browse Source

Fixed #261. Use strncmp instead of a comparing trick.

tags/v0.2.8^2
Zhang Xianyi 12 years ago
parent
commit
534c5ec919
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      driver/others/init.c

+ 2
- 1
driver/others/init.c View File

@@ -83,6 +83,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <dirent.h>
#include <dlfcn.h>
#include <unistd.h>
#include <string.h>

#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]);



Loading…
Cancel
Save