mirror of https://git.ffmpeg.org/ffmpeg.git
file: properly forward errors from file_read() and file_write()
Bug-Id: 881 CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
parent
5a1a9da8a7
commit
e05f7ed543
|
@ -59,13 +59,15 @@ static const AVClass file_class = {
|
|||
static int file_read(URLContext *h, unsigned char *buf, int size)
|
||||
{
|
||||
FileContext *c = h->priv_data;
|
||||
return read(c->fd, buf, size);
|
||||
int 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;
|
||||
return write(c->fd, buf, size);
|
||||
int ret = write(c->fd, buf, size);
|
||||
return (ret == -1) ? AVERROR(errno) : ret;
|
||||
}
|
||||
|
||||
static int file_get_handle(URLContext *h)
|
||||
|
|
Loading…
Reference in New Issue