From 380f884ab973ce355da0a0ca90a884f67bdba00c Mon Sep 17 00:00:00 2001 From: Jia Zhang Date: Wed, 29 Jul 2020 08:09:58 +0000 Subject: [PATCH] rune/libenclave/skeleton: Fix detection of sgx device Use st_rdev to retrieve the major number of device. Signed-off-by: Jia Zhang --- .../internal/runtime/pal/skeleton/liberpal-skeleton.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rune/libenclave/internal/runtime/pal/skeleton/liberpal-skeleton.c b/rune/libenclave/internal/runtime/pal/skeleton/liberpal-skeleton.c index 0faa96c..7e9609c 100644 --- a/rune/libenclave/internal/runtime/pal/skeleton/liberpal-skeleton.c +++ b/rune/libenclave/internal/runtime/pal/skeleton/liberpal-skeleton.c @@ -39,7 +39,7 @@ static bool is_sgx_device(const char *dev) rc = stat(dev, &st); if (!rc) { - if ((st.st_mode & S_IFCHR) && (major(st.st_dev) == 10)) + if ((st.st_mode & S_IFCHR) && (major(st.st_rdev) == 10)) return true; } -- GitLab