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)
Fri, Dec 20, 6:11 PM
Unknown Object (File)
Fri, Dec 20, 12:17 PM
Unknown Object (File)
Tue, Dec 3, 1:21 PM
Unknown Object (File)
Nov 19 2024, 10:49 PM
Unknown Object (File)
Nov 14 2024, 8:11 PM
Unknown Object (File)
Nov 5 2024, 7:56 AM
Unknown Object (File)
Nov 5 2024, 7:54 AM
Unknown Object (File)
Oct 5 2024, 12:00 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.