summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2013-10-31 14:51:01 +0100
committerColin Walters <walters@verbum.org>2013-10-31 12:43:55 -0400
commitb40878bf364fab284755a488aa2704079efac307 (patch)
tree334975807c74798410b42b3b7361b7eb21b1bbf2
parentaaa4e8623c578a1cf385f615ebd9713b5c18afa0 (diff)
downloadlibgsystem-b40878bf364fab284755a488aa2704079efac307.tar.gz
file-utils: gs_file_open_in_tmpdir_at did never retry
In case of creating an existing file name, gs_file_open_in_tmpdir_at did not retry and failed to create the temporary file (while signalling success). This error was found by running Coverity. Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r--gsystem-file-utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gsystem-file-utils.c b/gsystem-file-utils.c
index 73d947f..41cd769 100644
--- a/gsystem-file-utils.c
+++ b/gsystem-file-utils.c
@@ -495,7 +495,8 @@ gs_file_open_in_tmpdir_at (int tmpdir_fd,
_set_error_from_errno (error);
goto out;
}
- break;
+ else if (fd != -1)
+ break;
}
if (i == max_attempts)
{