Skip to content

Commit

Permalink
entry.c: use error_errno()
Browse files Browse the repository at this point in the history
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
pclouds authored and gitster committed May 9, 2016
1 parent 9f9a522 commit e1ebb3c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions entry.c
Expand Up @@ -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;
}

Expand All @@ -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);
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit e1ebb3c

Please sign in to comment.