copy.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>
This commit is contained in:
parent
5cc026e218
commit
37653a130a
6
copy.c
6
copy.c
@ -42,15 +42,15 @@ int copy_file(const char *dst, const char *src, int mode)
|
|||||||
status = copy_fd(fdi, fdo);
|
status = copy_fd(fdi, fdo);
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case COPY_READ_ERROR:
|
case COPY_READ_ERROR:
|
||||||
error("copy-fd: read returned %s", strerror(errno));
|
error_errno("copy-fd: read returned");
|
||||||
break;
|
break;
|
||||||
case COPY_WRITE_ERROR:
|
case COPY_WRITE_ERROR:
|
||||||
error("copy-fd: write returned %s", strerror(errno));
|
error_errno("copy-fd: write returned");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
close(fdi);
|
close(fdi);
|
||||||
if (close(fdo) != 0)
|
if (close(fdo) != 0)
|
||||||
return error("%s: close error: %s", dst, strerror(errno));
|
return error_errno("%s: close error", dst);
|
||||||
|
|
||||||
if (!status && adjust_shared_perm(dst))
|
if (!status && adjust_shared_perm(dst))
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user