Skip to content

Commit e1ebb3c

Browse files
pcloudsgitster
authored andcommitted
entry.c: use error_errno()
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9f9a522 commit e1ebb3c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

entry.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ static int write_entry(struct cache_entry *ce,
168168
ret = symlink(new, path);
169169
free(new);
170170
if (ret)
171-
return error("unable to create symlink %s (%s)",
172-
path, strerror(errno));
171+
return error_errno("unable to create symlink %s",
172+
path);
173173
break;
174174
}
175175

@@ -186,8 +186,7 @@ static int write_entry(struct cache_entry *ce,
186186
fd = open_output_fd(path, ce, to_tempfile);
187187
if (fd < 0) {
188188
free(new);
189-
return error("unable to create file %s (%s)",
190-
path, strerror(errno));
189+
return error_errno("unable to create file %s", path);
191190
}
192191

193192
wrote = write_in_full(fd, new, size);
@@ -284,8 +283,7 @@ int checkout_entry(struct cache_entry *ce,
284283
return error("%s is a directory", path.buf);
285284
remove_subtree(&path);
286285
} else if (unlink(path.buf))
287-
return error("unable to unlink old '%s' (%s)",
288-
path.buf, strerror(errno));
286+
return error_errno("unable to unlink old '%s'", path.buf);
289287
} else if (state->not_new)
290288
return 0;
291289

0 commit comments

Comments
 (0)