automake-patches
[Top][All Lists]
Advanced

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

[bug#60807] [PATCH v2] tests: reuse am_cv_filesystem_timestamp_resolutio


From: Jacob Bachmeyer
Subject: [bug#60807] [PATCH v2] tests: reuse am_cv_filesystem_timestamp_resolution
Date: Mon, 16 Jan 2023 20:18:16 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 SeaMonkey/1.1.17 Mnenhy/0.7.6.0

Mike Frysinger wrote:
On 14 Jan 2023 21:43, Jacob Bachmeyer wrote:
[...]
You could also exploit that || short-circuits in the shell and replace the "if" block with " $PERL ... || sleep='sleep ''2' ". This allows you to directly execute a command on a false result and (I think) it is portable, too. (I half-expect someone to correct me on that along the lines of "the shell on Obscurix has a bug where || implicitly uses a subshell".)

personally i find (ab)use of `||` and `&&` tends to lead to unmaintainable code.
i.e. it tends to produce write-once-read-never code akin to most perl.  so if
the construct has been in use already and isn't causing issues, i'd use it.

In Perl at least, use of the "word forms" of those operators for flow control is considered idiomatic Perl, most often seen in the form "open ... or die ...;" and indeed in another of your patches as "stat ... or fatal ...". :-)


-- Jacob






reply via email to

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