223 |
# perl was not built with -Ud_flock. Normally, this problem is harmless, |
# perl was not built with -Ud_flock. Normally, this problem is harmless, |
224 |
# so ignore the ENOLCK errors that are reported in that situation, |
# so ignore the ENOLCK errors that are reported in that situation, |
225 |
# However, if the invoker is using "make -j", the problem is not harmless, |
# However, if the invoker is using "make -j", the problem is not harmless, |
226 |
# so report it in that case. Admittedly this is a bit of a hack. |
# so report it in that case, by inspecting MAKEFLAGS and looking for |
227 |
|
# any arguments indicating that the invoker used -j. |
228 |
|
# Admittedly this is a bit of a hack. |
229 |
if (!flock ($fh, $mode) |
if (!flock ($fh, $mode) |
230 |
&& (!$!{ENOLCK} || " $ENV{'MAKEFLAGS'}" =~ / (-j|--jobs)/)) |
&& (!$!{ENOLCK} |
231 |
|
|| " -$ENV{'MAKEFLAGS'}" =~ / (-[BdeikrRsSw]*j|---?jobs)/)) |
232 |
{ |
{ |
233 |
my $file = $fh->name; |
my $file = $fh->name; |
234 |
fatal "cannot lock $file with mode $mode: $!"; |
fatal "cannot lock $file with mode $mode (perhaps you are running make -j on a lame NFS client?): $!"; |
235 |
} |
} |
236 |
} |
} |
237 |
|
|