util: make sure we don't clobber errno in error path

This commit is contained in:
Lennart Poettering
2015-07-11 14:19:36 -03:00
parent 43694a8cc7
commit 64ee7ab462
+1 -1
View File
@@ -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;