From: Stewart Smith Date: Tue, 4 Mar 2014 04:27:27 +0000 (+1100) Subject: lscpu: don't assume filesystem supports d_type when searching for NUMA nodes X-Git-Tag: v2.25-rc1~561 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c0cf4ae9b05a88dfbace18dd05d23fb0b2d19dab;p=thirdparty%2Futil-linux.git lscpu: don't assume filesystem supports d_type when searching for NUMA nodes Not all file systems support the d_type field and simply checking for d_type == DT_DIR in is_node_dirent would cause the test suite to fail if run on (for example) XFS. The simple fix is to check for DT_DIR or DT_UNKNOWN in is_node_dirent. Signed-off-by: Stewart Smith --- diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c index b8840ef90a..4760d4e390 100644 --- a/sys-utils/lscpu.c +++ b/sys-utils/lscpu.c @@ -919,7 +919,7 @@ static inline int is_node_dirent(struct dirent *d) return d && #ifdef _DIRENT_HAVE_D_TYPE - d->d_type == DT_DIR && + (d->d_type == DT_DIR || d->d_type == DT_UNKNOWN) && #endif strncmp(d->d_name, "node", 4) == 0 && isdigit_string(d->d_name + 4);