Skip to content

Commit

Permalink
vcs-svn: use error_errno()
Browse files Browse the repository at this point in the history
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
pclouds authored and gitster committed May 9, 2016
1 parent d2b6afa commit 1c8ead9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions vcs-svn/line_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion vcs-svn/sliding_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions vcs-svn/svndiff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down
4 changes: 2 additions & 2 deletions vcs-svn/svndump.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,15 +501,15 @@ 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;
}

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;
}
Expand Down

0 comments on commit 1c8ead9

Please sign in to comment.