diff file.c @ 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 dd9383951cb9
children 2f09b8dc4e08
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;