vcs-svn: use error_errno()
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sun, 8 May 2016 09:48:00 +0000 (16:48 +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>
vcs-svn/line_buffer.c
vcs-svn/sliding_window.c
vcs-svn/svndiff.c
vcs-svn/svndump.c
index 57cc1cec033f638e6d408370039b46b653289e84..e416caf8a4fc744232ca95450bce2b6109388aad 100644 (file)
@@ -53,9 +53,9 @@ long buffer_tmpfile_prepare_to_read(struct line_buffer *buf)
 {
        long pos = ftell(buf->infile);
        if (pos < 0)
-               return error("ftell error: %s", strerror(errno));
+               return error_errno("ftell error");
        if (fseek(buf->infile, 0, SEEK_SET))
-               return error("seek error: %s", strerror(errno));
+               return error_errno("seek error");
        return pos;
 }
 
index f11d490995ee7e3367c1d18e1058f2e322cfa177..06d273c9e8ce2b6b8ddbf967693e5305355d5be6 100644 (file)
@@ -12,7 +12,7 @@ static int input_error(struct line_buffer *file)
 {
        if (!buffer_ferror(file))
                return error("delta preimage ends early");
-       return error("cannot read delta preimage: %s", strerror(errno));
+       return error_errno("cannot read delta preimage");
 }
 
 static int skip_or_whine(struct line_buffer *file, off_t gap)
index 74c97c4543d1fa707961aab1453edfb69b2679d2..75c753162ab3b39293b258ec51f06dcc8d07ec3a 100644 (file)
@@ -64,13 +64,13 @@ static int write_strbuf(struct strbuf *sb, FILE *out)
 {
        if (fwrite(sb->buf, 1, sb->len, out) == sb->len)        /* Success. */
                return 0;
-       return error("cannot write delta postimage: %s", strerror(errno));
+       return error_errno("cannot write delta postimage");
 }
 
 static int error_short_read(struct line_buffer *input)
 {
        if (buffer_ferror(input))
-               return error("error reading delta: %s", strerror(errno));
+               return error_errno("error reading delta");
        return error("invalid delta: unexpected end of file");
 }
 
index 31d1d83d451e0e78f19067799d14e555a62e2cc8..e4b395963b9457a680a369c3e1997c799f8793ab 100644 (file)
@@ -501,7 +501,7 @@ static void init(int report_fd)
 int svndump_init(const char *filename)
 {
        if (buffer_init(&input, filename))
-               return error("cannot open %s: %s", filename ? filename : "NULL", strerror(errno));
+               return error_errno("cannot open %s", filename ? filename : "NULL");
        init(REPORT_FILENO);
        return 0;
 }
@@ -509,7 +509,7 @@ int svndump_init(const char *filename)
 int svndump_init_fd(int in_fd, int back_fd)
 {
        if(buffer_fdinit(&input, xdup(in_fd)))
-               return error("cannot open fd %d: %s", in_fd, strerror(errno));
+               return error_errno("cannot open fd %d", in_fd);
        init(xdup(back_fd));
        return 0;
 }