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

Re: [PATCH] find RLIM_NLIMITS correctly on Cygwin



Jun T wrote on Tue, 24 Mar 2020 10:33 +0900:
> > 2020/03/23 14:41, I wrote:
> > 
> > Personally I feel only adding a test (B12limit.zsh) is enough for now, but
> > have no objection to adding a runtime check in rlimits.c.  
> 
> If I add the runtime check, and if there is a duplicated option letter,
> I get the error message 'duplicate ulimit option letter' every time
> I start zsh. This may be quite annoying for ordinary users.

That message is printed by the DPUTS1() macro.  That macro expands to
nothing unless the «DEBUG» preprocessor symbol is defined, which
happens if one runs configure with --enable-zsh-debug.  Ordinary users
shouldn't see that.

> B12limit.ztst (limit| grep UNKNOWN || print OK) fails due to the error
> message; I think it's OK. But V01zmodload.ztst also fails due to the
> message, and other tests would fail if they use the rlimits module.
> 

Only in --enable-zsh-debug mode, and the fix is trivial: edit
known_resources and change one of the two colliding resources' letter
to 'N'.  Does this address your concerns, or would you prefer something
more?  We could even remove the DPUTS1() call entirely.

> So I think just adding a test for duplicated option letter is enough.
> If someone add a new resource then it is their responsibility to
> confirm that all the tests pass. I think ordinary users need not see
> the error message.

They won't, unless they configure with --enable-zsh-debug.

Cheers,

Daniel



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