tech-toolchain archive

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

Re: TOCTOU bug in make(1)



Am 07.10.2022 um 00:28 schrieb David Holland:
On Fri, Oct 07, 2022 at 12:46:06AM +0300, Valery Ushakov wrote:
  > It also, unnecessarily, IMHO, decided to change the return type to
  > a more "modern" bool thus further obscuring the fact that the
  > function was a simple wrapper around unlink(2).

Can we revert that? Using bool for success/failure is ambiguous (does
true mean it succeeded or failed? both are reasonable) whereas 0/-1 or
zero/nonzero is a clearly established and well understood idiom.

Can you show me a function in the NetBSD source tree that has return
type 'bool' (not 'int') and returns 'true' to indicate failure?

I searched for '^\.Tf bool$' and found several functions that return
'false' to indicate failure but none that returned 'true' to indicate
failure.

Roland



Home | Main Index | Thread Index | Old Index