test: return the right value from open_restricted
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 6 May 2015 01:55:48 +0000 (11:55 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 6 May 2015 01:56:40 +0000 (11:56 +1000)
fd or negative errno on failure.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test/litest.c

index d3b5d6c..d0043da 100644 (file)
@@ -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