From b434907c5e587dd366836ce5c7fa4194ae78345f Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Sun, 4 Aug 2019 09:48:13 +0200 Subject: [PATCH] tests: mockup: make sure the gpio-mockup debugfs directory is writable The gpio-mockup library needs write permissions to make full use of the debugfs interface. Add the W_OK flag to the call to access() when preparing the context structure. Signed-off-by: Bartosz Golaszewski --- tests/mockup/gpio-mockup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mockup/gpio-mockup.c b/tests/mockup/gpio-mockup.c index c7a3152..22a3a58 100644 --- a/tests/mockup/gpio-mockup.c +++ b/tests/mockup/gpio-mockup.c @@ -112,7 +112,7 @@ EXPORT struct gpio_mockup *gpio_mockup_new(void) goto err_unref_module; /* We need to check that the gpio-mockup debugfs directory exists. */ - rv = access("/sys/kernel/debug/gpio-mockup", R_OK); + rv = access("/sys/kernel/debug/gpio-mockup", R_OK | W_OK); if (rv) goto err_unref_module; -- 2.30.2