From 1ea69203acd49d5b1182a184babbc05f096be939 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 6 May 2015 11:55:48 +1000 Subject: [PATCH] test: return the right value from open_restricted fd or negative errno on failure. Signed-off-by: Peter Hutterer --- test/litest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/litest.c b/test/litest.c index d3b5d6cb..d0043da2 100644 --- a/test/litest.c +++ b/test/litest.c @@ -393,7 +393,8 @@ litest_log_handler(struct libinput *libinput, static int open_restricted(const char *path, int flags, void *userdata) { - return open(path, flags); + int fd = open(path, flags); + return fd < 0 ? -errno : fd; } static void