diff --git a/src/native/libs/System.Native/pal_io.c b/src/native/libs/System.Native/pal_io.c index 24a9953ad464c9..609a67ac622827 100644 --- a/src/native/libs/System.Native/pal_io.c +++ b/src/native/libs/System.Native/pal_io.c @@ -377,11 +377,9 @@ int32_t SystemNative_MemfdSupported(void) int32_t major, minor; // memfd_create is only known to work properly on kernel version > 3.17 and throws SIGSEGV instead of ENOTSUP - if (sscanf(uts.release, "%d.%d", &major, &minor) == 2) + if (sscanf(uts.release, "%d.%d", &major, &minor) == 2 && major < 3 || (major == 3 && minor < 17)) { - if (major < 3 || (major == 3 && minor < 17)) { - return 0; - } + return 0; } #endif