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:
Daniel Mack
2015-07-11 13:35:50 -04:00
+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;