diff options
author | 2016-04-23 01:53:46 +0200 | |
---|---|---|
committer | 2016-04-23 01:53:46 +0200 | |
commit | f5df6472b4028166ea1d51f15bb8ed1455fde472 (patch) | |
tree | 2fd6cf377579df5e62f56a19a33eecdf803538a6 /src/core/lib | |
parent | 94a353aa460e618071572cd42f2106353fda6abe (diff) |
Refactor.
Diffstat (limited to 'src/core/lib')
-rw-r--r-- | src/core/lib/support/tmpfile_msys.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/core/lib/support/tmpfile_msys.c b/src/core/lib/support/tmpfile_msys.c index f0f803aa75..2fdc89a64f 100644 --- a/src/core/lib/support/tmpfile_msys.c +++ b/src/core/lib/support/tmpfile_msys.c @@ -57,15 +57,13 @@ FILE *gpr_tmpfile(const char *prefix, char **tmp_filename_out) { /* Generate a unique filename with our template + temporary path. */ success = GetTempFileNameA(".", prefix, 0, tmp_filename); fprintf(stderr, "success = %d\n", success); - if (!success) goto end; - /* Open a file there. */ - result = fopen(tmp_filename, "wb+"); - fprintf(stderr, "result = %p\n", result); - if (result == NULL) goto end; - -end: - if (result && tmp_filename_out) { + if (success) { + /* Open a file there. */ + result = fopen(tmp_filename, "wb+"); + fprintf(stderr, "result = %p\n", result); + } + if (result != NULL && tmp_filename_out) { *tmp_filename_out = gpr_strdup(tmp_filename); } |