This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
prune faulty dead logic in pp_flock
authorZefram <zefram@fysh.org>
Fri, 17 Feb 2012 21:24:13 +0000 (21:24 +0000)
committerZefram <zefram@fysh.org>
Fri, 17 Feb 2012 21:26:08 +0000 (21:26 +0000)
pp_flock had code to implicitly use the "last read" I/O handle if invoked
with no arguments.  Actually both of its arguments are mandatory, so this
could never be reached.  It was presumably cargo-culted from another op
such as pp_tell.

pp_sys.c

index 245e076..33b86ab 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2341,7 +2341,7 @@ PP(pp_flock)
     dVAR; dSP; dTARGET;
     I32 value;
     const int argtype = POPi;
-    GV * const gv = (MAXARG == 0) ? PL_last_in_gv : MUTABLE_GV(POPs);
+    GV * const gv = MUTABLE_GV(POPs);
     IO *const io = GvIO(gv);
     PerlIO *const fp = io ? IoIFP(io) : NULL;