diff options
author | Martin Storsjö <martin@martin.st> | 2009-07-27 12:36:22 +0000 |
---|---|---|
committer | Benoit Fouet <benoit.fouet@free.fr> | 2009-07-27 12:36:22 +0000 |
commit | fbf7e805b0331c8329ad46ba7d40962d8b3d1a0c (patch) | |
tree | f494bfb1c19670ae29f3358da47219c1d9512a06 | |
parent | 94daf2e94c253b3ca1aa1b4cb0b119aff464f3a6 (diff) | |
download | ffmpeg-fbf7e805b0331c8329ad46ba7d40962d8b3d1a0c.tar.gz |
Only consider -1 as an error return value for open().
This is:
- what Posix says (-1 on error, >=0 on success)
- fixing a bug on winCE (<0 sometimes)
Patch by Martin Storsjö: martin martin st
Originally committed as revision 19513 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/file.c b/libavformat/file.c index da0ce15094..d2cb5302d4 100644 --- a/libavformat/file.c +++ b/libavformat/file.c @@ -51,7 +51,7 @@ static int file_open(URLContext *h, const char *filename, int flags) access |= O_BINARY; #endif fd = open(filename, access, 0666); - if (fd < 0) + if (fd == -1) return AVERROR(ENOENT); h->priv_data = (void *) (intptr_t) fd; return 0; |