fs-util: don't alter errno in unlink_tempfilep()
Functions whose only purpose is to be used with _cleanup_() should not touch errno, so that failing removals do not alter errno at unexpected places. This is already done in unlink_and_freep(), rmdir_and_freep(), rm_rf_physical_and_freep(), hence do so for unlink_tempfilep(), too. Follow-up for #9013
This commit is contained in:
parent
2f09974f34
commit
6982156044
|
@ -1072,7 +1072,7 @@ void unlink_tempfilep(char (*p)[]) {
|
||||||
* successfully created. We ignore both the rare case where the
|
* successfully created. We ignore both the rare case where the
|
||||||
* original suffix is used and unlink failures. */
|
* original suffix is used and unlink failures. */
|
||||||
if (!endswith(*p, ".XXXXXX"))
|
if (!endswith(*p, ".XXXXXX"))
|
||||||
(void) unlink(*p);
|
(void) unlink_noerrno(*p);
|
||||||
}
|
}
|
||||||
|
|
||||||
int unlinkat_deallocate(int fd, const char *name, int flags) {
|
int unlinkat_deallocate(int fd, const char *name, int flags) {
|
||||||
|
|
Loading…
Reference in a new issue