Chromium Code Reviews| Index: media/ffmpeg/file_protocol.cc |
| diff --git a/media/ffmpeg/file_protocol.cc b/media/ffmpeg/file_protocol.cc |
| index 2d1bd1d9427b98b702027eea123a97d0e09f8d11..07a6697c4e4b9d60d84211bcd4292892ec6d2cf2 100644 |
| --- a/media/ffmpeg/file_protocol.cc |
| +++ b/media/ffmpeg/file_protocol.cc |
| @@ -14,6 +14,7 @@ |
| #include <fcntl.h> |
| #include "base/compiler_specific.h" |
| +#include "base/eintr_wrapper.h" |
| #include "base/file_util.h" |
| #include "base/logging.h" |
| #include "media/ffmpeg/ffmpeg_common.h" |
| @@ -47,23 +48,19 @@ int OpenContext(URLContext* h, const char* filename, int flags) { |
| } |
| int ReadContext(URLContext* h, unsigned char* buf, int size) { |
| - return read(GetHandle(h), buf, size); |
| + return HANDLE_EINTR(read(GetHandle(h), buf, size)); |
| } |
| int WriteContext(URLContext* h, unsigned char* buf, int size) { |
| - return write(GetHandle(h), buf, size); |
| + return HANDLE_EINTR(write(GetHandle(h), buf, size)); |
| } |
| -offset_t SeekContext(URLContext* h, offset_t offset, int whence) { |
| -#if defined(OS_WIN) |
| - return lseek(GetHandle(h), static_cast<long>(offset), whence); |
| -#else |
| - return lseek(GetHandle(h), offset, whence); |
| -#endif |
| +int64 SeekContext(URLContext* h, int64 offset, int whence) { |
| + return lseek(GetHandle(h), static_cast<off_t>(offset), whence); |
|
wtc
2010/05/19 17:20:42
MSVC has _lseeki64, which takes a 64-bit offset ar
agl
2010/05/19 18:07:32
I figured that off_t would be 64-bit on Windows, b
awong
2010/05/19 18:12:56
Doesn't off_t change on glibc depending on the var
wtc
2010/05/19 18:44:55
We can add a static assertion to assert that sizeo
|
| } |
| int CloseContext(URLContext* h) { |
| - return close(GetHandle(h)); |
| + return HANDLE_EINTR(close(GetHandle(h))); |
| } |
| } // namespace |