bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gawk 5.1.1 testsuite failures


From: arnold
Subject: Re: gawk 5.1.1 testsuite failures
Date: Tue, 16 Nov 2021 08:27:35 -0700
User-agent: Heirloom mailx 12.5 7/5/10

I would never have thought of that.  It's a rather interesting "hack".
Thanks. I will probably do this.

Arnold

"Miguel Pineiro Jr." <mpj@pineiro.cc> wrote:

> Hi, Arnold.
>
>  A suggestion for eliminating the (recently disabled) race in iolint.awk:
>
> Since the test doesn't use --posix, it can use ENVIRON[] to pass to a
> child a string to eval. This makes it easy to execute different, simple
> commands without modifying the redirection expression.
>
> The `read` in the second pipeline prevents the race.
>
> BEGIN {
>       LINT = 1
>
>       # `%.*s' used for input pipe and output pipe
>       pipecmd = "eval $CMD_TO_RUN"
>
>       ENVIRON["CMD_TO_RUN"] = "echo hello"
>       pipecmd | getline junk 
>       ENVIRON["CMD_TO_RUN"] = "read junk"
>       print "hello" | pipecmd
>
>       print close(pipecmd)
>       print close(pipecmd)
>       fflush()
> }
>
> Take care,
> Miguel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]