summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-08-01 16:12:34 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2020-08-01 16:13:32 -0700
commit217d6d92df9ea44c225ea815e121eb5c539bb748 (patch)
treebc9dbd57976716684a0e15f6332adddb2820ec44 /lib
parent1761472779a5161b2d793d93d539ebf6d8c676d6 (diff)
downloadautomake-217d6d92df9ea44c225ea815e121eb5c539bb748.tar.gz
port XFile locking to OpenIndiana
I observed this problem on an NFS filesystem on an OpenIndiana host (5.11 illumos-dde7ba523f i386). fcntl (fd, F_SETLK, ...) failed with errno == EINVAL, which POSIX allows for files that do not support locking. * lib/Automake/XFile.pm (lock): Treat EINVAL like ENOLCK.
Diffstat (limited to 'lib')
-rw-r--r--lib/Automake/XFile.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Automake/XFile.pm b/lib/Automake/XFile.pm
index 239c9b726..7d54404f0 100644
--- a/lib/Automake/XFile.pm
+++ b/lib/Automake/XFile.pm
@@ -232,7 +232,8 @@ sub lock
# Unless explicitly configured otherwise, Perl implements its 'flock' with the
# first of flock(2), fcntl(2), or lockf(3) that works. These can fail on
- # NFS-backed files, with ENOLCK (GNU/Linux) or EOPNOTSUPP (FreeBSD); we
+ # NFS-backed files, with ENOLCK (GNU/Linux) or EOPNOTSUPP (FreeBSD) or
+ # EINVAL (OpenIndiana, as per POSIX 1003.1-2017 fcntl spec); we
# usually ignore these errors. If $ENV{MAKEFLAGS} suggests that a parallel
# invocation of 'make' has invoked the tool we serve, report all locking
# failures and abort.
@@ -251,7 +252,7 @@ sub lock
msg ($make_j ? 'fatal' : 'unsupported',
"cannot lock $file with mode $mode: $!" . ($make_j ? $note : ""))
- if $make_j || !($!{ENOLCK} || $!{EOPNOTSUPP});
+ if $make_j || !($!{EINVAL} || $!{ENOLCK} || $!{EOPNOTSUPP});
}
}