summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/tst-fanotify.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-09-05 03:02:46 -0400
committerMike Frysinger <vapier@gentoo.org>2013-09-05 03:04:01 -0400
commitbb8ea71379ce66936284a6e7ea60dc8255d2ed7f (patch)
tree1c710c7a73c0427d8cd5d97ad53dfd1d0628dbfb /sysdeps/unix/sysv/linux/tst-fanotify.c
parent2deb7bdb7433ba78ec00cb61d24d1be56e66e9b8 (diff)
downloadglibc-bb8ea71379ce66936284a6e7ea60dc8255d2ed7f.tar.gz
tst-fanotify: skip when we get back EPERM
Since fanotify_init requires CAP_SYS_ADMIN in order to work (which usually means running as root), we need to handle that error case too. Reported-by: Andreas Jaeger <aj@suse.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sysdeps/unix/sysv/linux/tst-fanotify.c')
-rw-r--r--sysdeps/unix/sysv/linux/tst-fanotify.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sysdeps/unix/sysv/linux/tst-fanotify.c b/sysdeps/unix/sysv/linux/tst-fanotify.c
index b88995d6f3..b21e160cad 100644
--- a/sysdeps/unix/sysv/linux/tst-fanotify.c
+++ b/sysdeps/unix/sysv/linux/tst-fanotify.c
@@ -29,11 +29,14 @@ do_test (void)
fd = fanotify_init (0, 0);
if (fd < 0)
{
- if (errno == ENOSYS)
- {
- puts ("SKIP: missing support for fanotify (check CONFIG_FANOTIFY=y)");
- return 0;
- }
+ switch (errno) {
+ case ENOSYS:
+ puts ("SKIP: missing support for fanotify (check CONFIG_FANOTIFY=y)");
+ return 0;
+ case EPERM:
+ puts ("SKIP: missing proper permissions for runtime test");
+ return 0;
+ }
perror ("fanotify_init (0, 0) failed");
return 1;