< prev index next >

src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java

Print this page
@@ -129,12 +129,12 @@
              throw new IllegalArgumentException("READ + APPEND not allowed");
          if (flags.append && flags.truncateExisting)
              throw new IllegalArgumentException("APPEND + TRUNCATE_EXISTING not allowed");
  
          FileDescriptor fdObj = open(dfd, path, pathForPermissionCheck, flags, mode);
-         return FileChannelImpl.open(fdObj, path.toString(), flags.read,
-                 flags.write, flags.direct, null);
+         return FileChannelImpl.open(fdObj, path.toString(), flags.read, flags.write,
+                 (flags.sync || flags.dsync), flags.direct, null);
      }
  
      /**
       * Constructs a file channel by opening the given file.
       */
< prev index next >