From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id C7E1A1F463 for ; Fri, 20 Dec 2019 01:42:08 +0000 (UTC) Date: Fri, 20 Dec 2019 01:42:08 +0000 From: Eric Wong To: meta@public-inbox.org Subject: Re: [PATCH] testcommon: dup original handles via open Message-ID: <20191220014208.GA17528@dcvr> References: <20191219083851.4829-1-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191219083851.4829-1-e@80x24.org> List-Id: Eric Wong wrote: > I was surprised when I noticed "local *STDIN = *STDIN" worked, > but that was with Perl 5.28.1. Unfortunately, we can't rely on > users or testers having such a recent Perl version. Even worse, > it was silently a no-op on Perl 5.24.1 on Debian 9.x. So, save > the original handle and manually restore the original via open, > when we're done. Wow, I suck at writing commit messages when sleepy :x The following is slightly better, at least I hope... Subject: [PATCH] testcommon: fix run_script for older Perls Using Perl "open" to dup(2) and save the old handles is required since "local *STDIN = *STDIN" does not work on old Perls. Even worse, this was silently a no-op when tested with Perl 5.24.1 on Debian 9.x and led to confusing failures in t/httpd-corner.t lsof(1) tests when t/v2mirror.t was run before it from the same worker process via t/run.perl.