Fixed #261. Use strncmp instead of a comparing trick.
This commit is contained in:
		
							parent
							
								
									63f14189e3
								
							
						
					
					
						commit
						4471c77905
					
				| 
						 | 
				
			
			@ -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…
	
		Reference in New Issue