better variable names in create_loose_object()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
diff --git a/lib/object_create.c b/lib/object_create.c
index 35cbd8b..e544db9 100644
--- a/lib/object_create.c
+++ b/lib/object_create.c
@@ -49,16 +49,16 @@ create_loose_object(struct got_object_id *id, FILE *content,
struct got_repository *repo)
{
const struct got_error *err = NULL, *unlock_err = NULL;
- char *objpath = NULL, *outpath = NULL;
- FILE *outfile = NULL;
+ char *objpath = NULL, *tmppath = NULL;
+ FILE *tmpfile = NULL;
struct got_lockfile *lf = NULL;
- size_t outlen = 0;
+ size_t tmplen = 0;
err = got_object_get_path(&objpath, id, repo);
if (err)
return err;
- err = got_opentemp_named(&outpath, &outfile, objpath);
+ err = got_opentemp_named(&tmppath, &tmpfile, objpath);
if (err) {
char *parent_path;
if (!(err->code == GOT_ERR_ERRNO && errno == ENOENT))
@@ -70,12 +70,12 @@ create_loose_object(struct got_object_id *id, FILE *content,
free(parent_path);
if (err)
goto done;
- err = got_opentemp_named(&outpath, &outfile, objpath);
+ err = got_opentemp_named(&tmppath, &tmpfile, objpath);
if (err)
goto done;
}
- err = got_deflate_to_file(&outlen, content, outfile);
+ err = got_deflate_to_file(&tmplen, content, tmpfile);
if (err)
goto done;
@@ -83,12 +83,12 @@ create_loose_object(struct got_object_id *id, FILE *content,
if (err)
goto done;
- if (rename(outpath, objpath) != 0) {
+ if (rename(tmppath, objpath) != 0) {
err = got_error_from_errno();
goto done;
}
- free(outpath);
- outpath = NULL;
+ free(tmppath);
+ tmppath = NULL;
if (chmod(objpath, GOT_DEFAULT_FILE_MODE) != 0) {
err = got_error_from_errno();
@@ -96,12 +96,12 @@ create_loose_object(struct got_object_id *id, FILE *content,
}
done:
free(objpath);
- if (outpath) {
- if (unlink(outpath) != 0 && err == NULL)
+ if (tmppath) {
+ if (unlink(tmppath) != 0 && err == NULL)
err = got_error_from_errno();
- free(outpath);
+ free(tmppath);
}
- if (outfile && fclose(outfile) != 0 && err == NULL)
+ if (tmpfile && fclose(tmpfile) != 0 && err == NULL)
err = got_error_from_errno();
if (lf)
unlock_err = got_lockfile_unlock(lf);