Commit 88e7ea3e authored by Hendrik Leppkes's avatar Hendrik Leppkes

Merge commit 'e05f7ed5'

* commit 'e05f7ed5':
  file: properly forward errors from file_read() and file_write()
Merged-by: 's avatarHendrik Leppkes <h.leppkes@gmail.com>
parents 1789e46d e05f7ed5
......@@ -105,19 +105,19 @@ static const AVClass pipe_class = {
static int file_read(URLContext *h, unsigned char *buf, int size)
{
FileContext *c = h->priv_data;
int r;
int ret;
size = FFMIN(size, c->blocksize);
r = read(c->fd, buf, size);
return (-1 == r)?AVERROR(errno):r;
ret = read(c->fd, buf, size);
return (ret == -1) ? AVERROR(errno) : ret;
}
static int file_write(URLContext *h, const unsigned char *buf, int size)
{
FileContext *c = h->priv_data;
int r;
int ret;
size = FFMIN(size, c->blocksize);
r = write(c->fd, buf, size);
return (-1 == r)?AVERROR(errno):r;
ret = write(c->fd, buf, size);
return (ret == -1) ? AVERROR(errno) : ret;
}
static int file_get_handle(URLContext *h)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment