Re: [PATCH blktests RFC 1/2] check: allow strict error-checking by "set -e" in each test case

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

 



On 5/30/25 8:56 AM, Bart Van Assche wrote:
On 5/30/25 12:54 AM, Shin'ichiro Kawasaki wrote:
@@ -695,9 +695,9 @@ _check() {
          if [[ $group != "$prev_group" ]]; then
              prev_group="$group"
              if [[ ${#tests[@]} -gt 0 ]]; then
-                if ! ( _run_group "${tests[@]}" ); then
-                    ret=1
-                fi
+                ( _run_group "${tests[@]}" )
+                # shellcheck disable=SC2181
+                (($? != 0)) && ret=1

Is the above change necessary? This command shows that the exclamation
mark does not affect subshells:

$ bash -c '!(set -e; false; echo set -e has been ignored)'
$

(replying to my own email)

Please ignore the above comment since another email from you shows that
the exclamation mark affects called functions even if these are called
from a subshell.

Thanks,

Bart.





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux