Mercurial > libavformat.hg
comparison file.c @ 2205:28eb72f5208a libavformat
Check for O_BINARY instead of a list of systems that need it
author | ramiro |
---|---|
date | Mon, 25 Jun 2007 20:34:20 +0000 |
parents | 5ce5fad0dfac |
children | 3dfa90f47d53 |
comparison
equal
deleted
inserted
replaced
2204:6f3e0f91b7db | 2205:28eb72f5208a |
---|---|
39 } else if (flags & URL_WRONLY) { | 39 } else if (flags & URL_WRONLY) { |
40 access = O_CREAT | O_TRUNC | O_WRONLY; | 40 access = O_CREAT | O_TRUNC | O_WRONLY; |
41 } else { | 41 } else { |
42 access = O_RDONLY; | 42 access = O_RDONLY; |
43 } | 43 } |
44 #if defined(__MINGW32__) || defined(CONFIG_OS2) || defined(__CYGWIN__) | 44 #ifdef O_BINARY |
45 access |= O_BINARY; | 45 access |= O_BINARY; |
46 #endif | 46 #endif |
47 fd = open(filename, access, 0666); | 47 fd = open(filename, access, 0666); |
48 if (fd < 0) | 48 if (fd < 0) |
49 return AVERROR(ENOENT); | 49 return AVERROR(ENOENT); |
94 if (flags & URL_WRONLY) { | 94 if (flags & URL_WRONLY) { |
95 fd = 1; | 95 fd = 1; |
96 } else { | 96 } else { |
97 fd = 0; | 97 fd = 0; |
98 } | 98 } |
99 #if defined(__MINGW32__) || defined(CONFIG_OS2) || defined(__CYGWIN__) | 99 #ifdef O_BINARY |
100 setmode(fd, O_BINARY); | 100 setmode(fd, O_BINARY); |
101 #endif | 101 #endif |
102 h->priv_data = (void *)(size_t)fd; | 102 h->priv_data = (void *)(size_t)fd; |
103 h->is_streamed = 1; | 103 h->is_streamed = 1; |
104 return 0; | 104 return 0; |