tmpfile-util: make sure errno is left untouched by CLEANUP_TMPFILE_AT()

This mimics how rm_rf_physical_and_free() operate, and we should do the
same here, and make clean-up error paths not touch errno needlessly.
This commit is contained in:
Lennart Poettering
2025-11-11 11:35:45 +01:00
parent a5023c7a4b
commit 1daf7b56bb

View File

@@ -447,7 +447,9 @@ void cleanup_tmpfile_data_done(struct cleanup_tmpfile_data *d) {
!*d->filename)
return;
(void) unlinkat(*d->dir_fd, *d->filename, 0);
PROTECT_ERRNO;
(void) unlinkat(*d->dir_fd, *d->filename, /* flags= */ 0);
d->dir_fd = NULL;
d->filename = NULL;
}