apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject svn commit: r929082 - /apr/apr/trunk/file_io/os2/readwrite.c
Date Tue, 30 Mar 2010 11:18:52 GMT
Author: bjh
Date: Tue Mar 30 11:18:52 2010
New Revision: 929082

URL: http://svn.apache.org/viewvc?rev=929082&view=rev
Log:
OS/2: Implement apr_file_sync().

Modified:
    apr/apr/trunk/file_io/os2/readwrite.c

Modified: apr/apr/trunk/file_io/os2/readwrite.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/os2/readwrite.c?rev=929082&r1=929081&r2=929082&view=diff
==============================================================================
--- apr/apr/trunk/file_io/os2/readwrite.c (original)
+++ apr/apr/trunk/file_io/os2/readwrite.c Tue Mar 30 11:18:52 2010
@@ -317,12 +317,22 @@ APR_DECLARE(apr_status_t) apr_file_flush
 
 APR_DECLARE(apr_status_t) apr_file_sync(apr_file_t *thefile)
 {
-    return APR_ENOTIMPL;
+    apr_status_t rv;
+    int rc;
+
+    rv = apr_file_flush(thefile);
+
+    if (rv != APR_SUCCESS) {
+        return rv;
+    }
+
+    rc = DosResetBuffer(thefile->filedes);
+    return APR_FROM_OS_ERROR(rc);
 }
 
 APR_DECLARE(apr_status_t) apr_file_datasync(apr_file_t *thefile)
 {
-    return APR_ENOTIMPL;
+    return apr_file_sync(thefile);
 }
 
 APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile)



Mime
View raw message