EINVAL is expected when f?pathconf() isn't implemented for a path
authorTony Cook <tony@develop-help.com>
Fri, 25 Jan 2013 11:09:25 +0000 (11:09 +0000)
committerTony Cook <tony@develop-help.com>
Sun, 27 Jan 2013 04:21:06 +0000 (15:21 +1100)
This can happen when a particular file system doesn't implement a
particular variable.

RT# 116463

ext/POSIX/t/sysconf.t

index 8590eef..ad1e482 100644 (file)
@@ -67,8 +67,15 @@ sub _check_and_report {
        like($return_val, qr/\A(?:-?[1-9][0-9]*|0 but true)\z/,
             'the returned value should be a signed integer');
     } else {
-       cmp_ok($errno, '==', 0, 'errno should be 0 as before the call')
-           or diag("\$!: $errno");
+      SKIP:
+       {
+           # POSIX specifies EINVAL is returned if the f?pathconf()
+           # isn't implemented for the specific path
+           skip "$description not implemented for this path", 1
+               if $errno == EINVAL && $description =~ /pathconf/;
+           cmp_ok($errno, '==', 0, 'errno should be 0 as before the call')
+               or diag("\$!: $errno");
+       }
     }
 }