OSDN Git Service

Make file_open() return the error code set in errno if open() fails,
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Mon, 26 Apr 2010 22:36:51 +0000 (22:36 +0000)
committerStefano Sabatini <stefano.sabatini-lala@poste.it>
Mon, 26 Apr 2010 22:36:51 +0000 (22:36 +0000)
rather than always ENOENT.

Originally committed as revision 22972 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/file.c

index d42a678..8873d5f 100644 (file)
@@ -53,7 +53,7 @@ static int file_open(URLContext *h, const char *filename, int flags)
 #endif
     fd = open(filename, access, 0666);
     if (fd == -1)
-        return AVERROR(ENOENT);
+        return AVERROR(errno);
     h->priv_data = (void *) (intptr_t) fd;
     return 0;
 }