Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug in C02cont.ztst's -N test



Matthew Martin wrote on Fri, Apr 29, 2016 at 20:01:31 -0500:
> @@ -154,7 +155,7 @@
>      ZTST_skip="[[ -N file ]] not supported on Cygwin"
>    elif (( isnfs )); then
>      ZTST_skip="[[ -N file ]] not supported with NFS"
> -  elif { df -k -- ${$({mount || /sbin/mount} | awk '/noatime/ {print $1,$3}'):-""} | tr -s ' ' | fgrep "$(df -k . | tail -1 | tr -s ' ')" } >&/dev/null; then
> +  elif sleep 58; [[ $unmodified_ls == "$(ls -lu $unmodified)" ]]; then
>      ZTST_skip="[[ -N file ]] not supported with noatime file system"
>    else
>      [[ -N $newnewnew && ! -N $unmodified ]]
> 
> but who wants to sleep for 60 seconds? (There's a sleep 2 earlier.)

Couldn't we sleep less, e.g., with the following? —

    elif ! () {
             repeat 58 {
               sleep 1
               if [[ $unmodified_ls != "$(ls -lu $unmodified)" ]]; then return 0; fi
             }
             return 1
           }; then
      ZTST_skip="…"

I assume we don't need to bother with fancy exponential (doubling)
backoffs in this context...

Cheers,

Daniel



Messages sorted by: Reverse Date, Date, Thread, Author