diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-09-07 16:11:57 +0200 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-09-07 16:11:57 +0200 |
commit | 88e7ea3e560373d443c49fa8857b999410225fe2 (patch) | |
tree | cbd55b1fe6ec78bf04bc94439001a4801fc2f4cc | |
parent | 1789e46d34c11da6067f7035f9221ecc49e79552 (diff) | |
parent | e05f7ed5436207f4a55f1978b223c7f8bc82af42 (diff) | |
download | ffmpeg-88e7ea3e560373d443c49fa8857b999410225fe2.tar.gz |
Merge commit 'e05f7ed5436207f4a55f1978b223c7f8bc82af42'
* commit 'e05f7ed5436207f4a55f1978b223c7f8bc82af42':
file: properly forward errors from file_read() and file_write()
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
-rw-r--r-- | libavformat/file.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/file.c b/libavformat/file.c index b855f56e25..d59aa42b50 100644 --- a/libavformat/file.c +++ b/libavformat/file.c @@ -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) |