vcs-svn: 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>
Nguyễn Thái Ngọc Duy committed
May 8, 2016 at 16:48 UTC
1c8ead97f842fb385ce729bc45760b439365b79a
4 files changed
+7
-7
vcs-svn/line_buffer.c
+2
-2
@@ -53,9 +53,9 @@ long buffer_tmpfile_prepare_to_read(struct line_buffer *buf)
53
{
54
long pos = ftell(buf->infile);
55
if (pos < 0)
56
- return error("ftell error: %s", strerror(errno));
56
+ return error_errno("ftell error");
57
if (fseek(buf->infile, 0, SEEK_SET))
58
- return error("seek error: %s", strerror(errno));
58
+ return error_errno("seek error");
59
return pos;
60
}
61
vcs-svn/sliding_window.c
+1
-1
@@ -12,7 +12,7 @@ static int input_error(struct line_buffer *file)
12
{
13
if (!buffer_ferror(file))
14
return error("delta preimage ends early");
15
- return error("cannot read delta preimage: %s", strerror(errno));
15
+ return error_errno("cannot read delta preimage");
16
}
17
18
static int skip_or_whine(struct line_buffer *file, off_t gap)
vcs-svn/svndiff.c
+2
-2
@@ -64,13 +64,13 @@ static int write_strbuf(struct strbuf *sb, FILE *out)
64
{
65
if (fwrite(sb->buf, 1, sb->len, out) == sb->len) /* Success. */
66
return 0;
67
- return error("cannot write delta postimage: %s", strerror(errno));
67
+ return error_errno("cannot write delta postimage");
68
}
69
70
static int error_short_read(struct line_buffer *input)
71
{
72
if (buffer_ferror(input))
73
- return error("error reading delta: %s", strerror(errno));
73
+ return error_errno("error reading delta");
74
return error("invalid delta: unexpected end of file");
75
}
76
vcs-svn/svndump.c
+2
-2
@@ -501,7 +501,7 @@ static void init(int report_fd)
501
int svndump_init(const char *filename)
502
{
503
if (buffer_init(&input, filename))
504
- return error("cannot open %s: %s", filename ? filename : "NULL", strerror(errno));
504
+ return error_errno("cannot open %s", filename ? filename : "NULL");
505
init(REPORT_FILENO);
506
return 0;
507
}
@@ -509,7 +509,7 @@ int svndump_init(const char *filename)
509
int svndump_init_fd(int in_fd, int back_fd)
510
{
511
if(buffer_fdinit(&input, xdup(in_fd)))
512
- return error("cannot open fd %d: %s", in_fd, strerror(errno));
512
+ return error_errno("cannot open fd %d", in_fd);
513
init(xdup(back_fd));
514
return 0;
515
}