Browse Source

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
tags/v0.6
Martin Storsjö Benoit Fouet 16 years ago
parent
commit
fbf7e805b0
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/file.c

+ 1
- 1
libavformat/file.c View File

@@ -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;


Loading…
Cancel
Save