X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Ffile.c;h=1352bcc54637f6d0a33752a64101a89ef2b3db56;hb=c12e1bd1bc7f0dd0dae2937d7f8c564e887c84ff;hp=a9c5281102d3fb8c6410eba7633562ae54358bfd;hpb=3dd44e507536e85d81e4f10d1a9bf8fc6082d9ab;p=ffmpeg diff --git a/libavformat/file.c b/libavformat/file.c index a9c5281102d..1352bcc5463 100644 --- a/libavformat/file.c +++ b/libavformat/file.c @@ -1,5 +1,5 @@ /* - * Buffered file io for ffmpeg system + * buffered file I/O * Copyright (c) 2001 Fabrice Bellard * * This file is part of FFmpeg. @@ -37,13 +37,15 @@ static int file_read(URLContext *h, unsigned char *buf, int size) { int fd = (intptr_t) h->priv_data; - return read(fd, buf, size); + int r = read(fd, buf, size); + return (-1 == r)?AVERROR(errno):r; } static int file_write(URLContext *h, const unsigned char *buf, int size) { int fd = (intptr_t) h->priv_data; - return write(fd, buf, size); + int r = write(fd, buf, size); + return (-1 == r)?AVERROR(errno):r; } static int file_get_handle(URLContext *h)