On Wed, 2021-05-12 at 21:00 +0000, Verma, Vishal L wrote:
Did you mean for the errno check to be if (errno != ENOENT) ?
This is what was causing the unit test failure for me. This patch on
top fixes it for me:
diff --git a/test/core.c b/test/core.c
index 44cb277..698bb66 100644
--- a/test/core.c
+++ b/test/core.c
@@ -139,7 +139,7 @@ int ndctl_test_init(struct kmod_ctx **ctx, struct
kmod_module **mod,
* determine from the environment variable NVDIMM_TEST_FAMILY
*/
if (access("/sys/bus/acpi", F_OK) == 0) {
- if (errno == ENOENT)
+ if (errno != ENOENT)
family = NVDIMM_FAMILY_INTEL;
}
Also, looks like for access(<path>, F_OK), it should be sufficient to
just test for the return value instead of return value and errno.