Page MenuHomeFreeBSD

Fix crunchgen usage of mkstemp()
ClosedPublic

Authored by arichardson on Aug 7 2020, 3:09 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 12, 7:18 PM
Unknown Object (File)
Sat, Oct 11, 10:30 AM
Unknown Object (File)
Thu, Sep 25, 2:35 AM
Unknown Object (File)
Wed, Sep 24, 5:59 AM
Unknown Object (File)
Sep 8 2025, 5:54 AM
Unknown Object (File)
Aug 30 2025, 10:48 PM
Unknown Object (File)
Aug 27 2025, 10:56 PM
Unknown Object (File)
Aug 24 2025, 12:05 AM
Subscribers

Details

Summary

On Glibc systems mkstemp can only be used once with the same template
string since it will be modified in-place and no longer contain any 'X' chars.
It is fine to reuse the same file here but we need to be explicit and use
open() instead of mkstemp() on the second use.

While touching this file also avoid a hardcoded /bin/pwd since that may not
work when building on non-FreeBSD systems.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

arichardson created this revision.

This seems a bit clunky, but if this is the least disruptive change it seems fine.

This revision is now accepted and ready to land.Aug 10 2020, 5:41 PM
This revision was automatically updated to reflect the committed changes.