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)
Thu, Nov 14, 8:11 PM
Unknown Object (File)
Tue, Nov 5, 7:56 AM
Unknown Object (File)
Tue, Nov 5, 7:54 AM
Unknown Object (File)
Oct 5 2024, 12:00 PM
Unknown Object (File)
Oct 5 2024, 12:35 AM
Unknown Object (File)
Oct 2 2024, 9:28 PM
Unknown Object (File)
Oct 2 2024, 4:30 PM
Unknown Object (File)
Oct 2 2024, 2:39 PM
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.