changeset 5110:147adb327b84 libavformat

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
author benoit
date Mon, 27 Jul 2009 12:36:22 +0000
parents 293c03f0d47f
children aa0edc246bca
files file.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/file.c	Sun Jul 26 19:09:35 2009 +0000
+++ b/file.c	Mon Jul 27 12:36:22 2009 +0000
@@ -51,7 +51,7 @@
     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;