mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-10-03 23:38:39 +00:00
Merge pull request #551 from poettering/fopen-temporary-noerrno
util: make sure we don't clobber errno in error path
This commit is contained in:
+1
-1
@@ -2533,7 +2533,7 @@ int fopen_temporary(const char *path, FILE **_f, char **_temp_path) {
|
||||
|
||||
f = fdopen(fd, "we");
|
||||
if (!f) {
|
||||
unlink(t);
|
||||
unlink_noerrno(t);
|
||||
free(t);
|
||||
safe_close(fd);
|
||||
return -errno;
|
||||
|
||||
Reference in New Issue
Block a user