copy.c: use error_errno()
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sun, 8 May 2016 09:47:40 +0000 (16:47 +0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 May 2016 19:29:08 +0000 (12:29 -0700)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
copy.c
diff --git a/copy.c b/copy.c
index 574fa1f09dadc2e9cc9a39702bafb352f71a56c4..4de6a110f0912d81def3f2dd4ffd6ddc9bc30d2f 100644 (file)
--- a/copy.c
+++ b/copy.c
@@ -42,15 +42,15 @@ int copy_file(const char *dst, const char *src, int mode)
        status = copy_fd(fdi, fdo);
        switch (status) {
        case COPY_READ_ERROR:
-               error("copy-fd: read returned %s", strerror(errno));
+               error_errno("copy-fd: read returned");
                break;
        case COPY_WRITE_ERROR:
-               error("copy-fd: write returned %s", strerror(errno));
+               error_errno("copy-fd: write returned");
                break;
        }
        close(fdi);
        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))
                return -1;