Commit 2665b6be authored by benoit's avatar benoit

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


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19513 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 14b7f508
...@@ -51,7 +51,7 @@ static int file_open(URLContext *h, const char *filename, int flags) ...@@ -51,7 +51,7 @@ static int file_open(URLContext *h, const char *filename, int flags)
access |= O_BINARY; access |= O_BINARY;
#endif #endif
fd = open(filename, access, 0666); fd = open(filename, access, 0666);
if (fd < 0) if (fd == -1)
return AVERROR(ENOENT); return AVERROR(ENOENT);
h->priv_data = (void *) (intptr_t) fd; h->priv_data = (void *) (intptr_t) fd;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment