From: Mike Frysinger Date: Thu, 5 Sep 2013 07:02:46 +0000 (-0400) Subject: tst-fanotify: skip when we get back EPERM X-Git-Tag: upstream/2.30~8735 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb8ea71379ce66936284a6e7ea60dc8255d2ed7f;p=external%2Fglibc.git 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 Signed-off-by: Mike Frysinger --- diff --git a/ChangeLog b/ChangeLog index 1f29127..773ea6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-09-05 Mike Frysinger + + * sysdeps/unix/sysv/linux/tst-fanotify.c (do_test): Skip test when + fanotify_init returns EPERM. + 2013-09-04 Joseph Myers * conform/conformtest.pl (newtoken): Treat tokens not allowed as diff --git a/sysdeps/unix/sysv/linux/tst-fanotify.c b/sysdeps/unix/sysv/linux/tst-fanotify.c index b88995d..b21e160 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;