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

Re: [BUG] zsystem:34: flock: invalid timeout value: '0'



On Fri, Jun 26, 2020 at 6:48 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
wrote:

>
> Regarding the actual bug report, the next steps are for the
> aforementioned commit to be confirmed as causing an unintended
> behaviour change and for a test and a patch to be written.
>

It's pretty obvious that the patch caused the change:

+               if (timeout < 1e-6 || timeout > 1073741823.) {
+                   zwarnnam(nam, "flock: invalid timeout value: '%s'",
+                            optarg);
+                   return 1;
+               }

Similarly:

+               if (timeout_param.u.d < 1
+                   || timeout_param.u.d > 0.999 * LONG_MAX) {
+                   zwarnnam(nam, "flock: invalid interval value: '%s'",
+                            optarg);
+                   return 1;
+               }

I don't know enough about dealing with the float-valued time specs to be
sure what to do about it, i.e., why a limit above zero was considered
necessary or whether zero needs to be a special case.


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