]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
port XFile locking to OpenIndiana
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 1 Aug 2020 23:12:34 +0000 (16:12 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 1 Aug 2020 23:13:32 +0000 (16:13 -0700)
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.

lib/Automake/XFile.pm

index 239c9b7264c236b8b7c5fcd9a3f0bc32f02a6167..7d54404f08616d2c776fd1d50f09c4f222ecd92c 100644 (file)
@@ -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});
     }
 }