From: Bartosz Golaszewski Date: Sun, 4 Aug 2019 07:48:13 +0000 (+0200) Subject: tests: mockup: make sure the gpio-mockup debugfs directory is writable X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b434907c5e587dd366836ce5c7fa4194ae78345f;p=qemu-gpiodev%2Flibgpiod.git 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 --- 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;