mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
Previously, if creating the file and fstat() fails, we would've ended up calling utimensat() on that file anyways with whatever was in sb. Not that this is an error likely to happen... We don't check for the return value of close() as we aren't writing anything to the file and the file is always created on success of open(). Reviewed by: kevans Approved by: kevans Fixes:cb54c500d0("touch: don't leak descriptor if fstat(2) fails") Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D55117 MFC after: 1 week (cherry picked from commitb8d55a8699)