]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix more test-errno issues
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 28 Mar 2017 19:44:19 +0000 (16:44 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 30 Mar 2017 21:23:43 +0000 (18:23 -0300)
This patch fixes some test-errno-linux unexpected returns for the
tested syscalls on some older kernels (I saw it on a Linux 3.8 on
armv7l).  Basically:

   - inotify_add_watch: Linux v3.8 (676a0675c) removed the test to
     check at least one valid bit in flags (to return EINVAL).  It
     was later added back in v3.9 (04df32fa1).

   - quotactl: returns ENOSYS for kernels not configured with
     CONFIG_QUOTA.

Checked on x86_64-linux-gnu and armv7l-linux-gnueabihf.

* sysdeps/unix/sysv/linux/test-errno-linux.c (do_test): Handle
non expected inotify_add_watch and quotactl return.

ChangeLog
sysdeps/unix/sysv/linux/test-errno-linux.c

index a4056e144cf1c9be40d87a9a474783de658e43ae..bddadc6aa474d83e0a0b4ee1d4f6b6650a9f39b7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-03-30  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+       * sysdeps/unix/sysv/linux/test-errno-linux.c (do_test): Handle
+       non expected inotify_add_watch and quotactl return.
+
 2017-03-30  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
 
        * math/e_rem_pio2l.c (__ieee754_rem_pio2l): Change return type
index 03a74bd6a141e018b2b50826f433eee31f273e76..87ed103c998dbbdca30bb494f2e3c3bbfaa16895 100644 (file)
@@ -147,7 +147,10 @@ do_test (void)
   fails |= test_wrp (EBADF, fdatasync, -1);
   fails |= test_wrp (EBADF, flock, -1, LOCK_SH);
   fails |= test_wrp (ESRCH, getpgid, -1);
-  fails |= test_wrp (EINVAL, inotify_add_watch, -1, "/", 0);
+  /* Linux v3.8 (676a0675c) removed the test to check at least one valid
+     bit in flags (to return EINVAL).  It was later added back in v3.9
+     (04df32fa1).  */
+  fails |= test_wrp2 (EINVAL, EBADF, inotify_add_watch, -1, "/", 0);
   fails |= test_wrp (EINVAL, mincore, (void *) -1, 0, vec);
   /* mlock fails if the result of the addition addr+len was less than addr
      (which indicates final address overflow), however on 32 bits binaries
@@ -157,7 +160,9 @@ do_test (void)
   fails |= test_wrp2 (EINVAL, ENOMEM, mlock, (void *) -1, 1);
   fails |= test_wrp (EINVAL, nanosleep, &ts, &ts);
   fails |= test_wrp (EINVAL, poll, &pollfd, -1, 0);
-  fails |= test_wrp (ENODEV, quotactl, Q_GETINFO, NULL, -1, (caddr_t) &dqblk);
+  /* quotactl returns ENOSYS for kernels not configured with CONFIG_QUOTA.  */
+  fails |= test_wrp2 (ENODEV, ENOSYS, quotactl, Q_GETINFO, NULL, -1,
+                     (caddr_t) &dqblk);
   fails |= test_wrp (EINVAL, sched_getparam, -1, &sch_param);
   fails |= test_wrp (EINVAL, sched_getscheduler, -1);
   fails |= test_wrp (EINVAL, sched_get_priority_max, -1);