diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-03-16 09:25:47 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-03-16 09:25:47 +0000 |
commit | c3e7dec3d321f76e4172fb8e8b24f72981c9fda0 (patch) | |
tree | 6f573a2cb63c2ecdf7a2db89eb7a10a65611d5ac /pjlib/src/pj/file_io_win32.c | |
parent | 3a61aaf35ae933d2f62877d7fca5a9a4ee1ecb56 (diff) |
Implemented ticket #185: Added pj_file_flush() to file I/O API to flush file buffers
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1074 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pj/file_io_win32.c')
-rw-r--r-- | pjlib/src/pj/file_io_win32.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pjlib/src/pj/file_io_win32.c b/pjlib/src/pj/file_io_win32.c index 2497be68..27848497 100644 --- a/pjlib/src/pj/file_io_win32.c +++ b/pjlib/src/pj/file_io_win32.c @@ -204,3 +204,17 @@ PJ_DEF(pj_status_t) pj_file_getpos( pj_oshandle_t fd, return PJ_SUCCESS; } +PJ_DEF(pj_status_t) pj_file_flush(pj_oshandle_t fd) +{ + BOOL rc; + + rc = FlushFileBuffers(fd); + + if (!rc) { + DWORD dwStatus = GetLastError(); + if (dwStatus != 0) + return PJ_RETURN_OS_ERROR(dwStatus); + } + + return PJ_SUCCESS; +} |