mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user