]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/file.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavformat / file.c
index a9c5281102d3fb8c6410eba7633562ae54358bfd..ffbccba0a4f386c8ed7bb012a8b0f25b95b09d1e 100644 (file)
 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)