aboutsummaryrefslogtreecommitdiffstats
path: root/entry.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2016-05-08 16:47:44 +0700
committerJunio C Hamano <gitster@pobox.com>2016-05-09 12:29:08 -0700
commite1ebb3c25bd42b06fe8f5f886af37dfac8a823a1 (patch)
treecd243e85a2d6b7f6db989fbcfda356923f3c6eed /entry.c
parenteditor.c: use error_errno() (diff)
downloadgit-e1ebb3c25bd42b06fe8f5f886af37dfac8a823a1.tar.xz
git-e1ebb3c25bd42b06fe8f5f886af37dfac8a823a1.zip
entry.c: use error_errno()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'entry.c')
-rw-r--r--entry.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/entry.c b/entry.c
index a4109574fa7..519e04227b7 100644
--- a/entry.c
+++ b/entry.c
@@ -168,8 +168,8 @@ static int write_entry(struct cache_entry *ce,
ret = symlink(new, path);
free(new);
if (ret)
- return error("unable to create symlink %s (%s)",
- path, strerror(errno));
+ return error_errno("unable to create symlink %s",
+ path);
break;
}
@@ -186,8 +186,7 @@ static int write_entry(struct cache_entry *ce,
fd = open_output_fd(path, ce, to_tempfile);
if (fd < 0) {
free(new);
- return error("unable to create file %s (%s)",
- path, strerror(errno));
+ return error_errno("unable to create file %s", path);
}
wrote = write_in_full(fd, new, size);
@@ -284,8 +283,7 @@ int checkout_entry(struct cache_entry *ce,
return error("%s is a directory", path.buf);
remove_subtree(&path);
} else if (unlink(path.buf))
- return error("unable to unlink old '%s' (%s)",
- path.buf, strerror(errno));
+ return error_errno("unable to unlink old '%s'", path.buf);
} else if (state->not_new)
return 0;