~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Martin Pool
  • Date: 2011-08-02 01:10:27 UTC
  • mfrom: (6015.9.4 2.4)
  • mto: This revision was merged to the branch mainline in revision 6047.
  • Revision ID: mbp@canonical.com-20110802011027-cv8b6h9q18ctxle4
merge up 2.3 and 2.4 into trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
2487
2487
    is_local_pid_dead = win32utils.is_local_pid_dead
2488
2488
else:
2489
2489
    is_local_pid_dead = _posix_is_local_pid_dead
 
2490
 
 
2491
 
 
2492
def fdatasync(fileno):
 
2493
    """Flush file contents to disk if possible.
 
2494
    
 
2495
    :param fileno: Integer OS file handle.
 
2496
    :raises TransportNotPossible: If flushing to disk is not possible.
 
2497
    """
 
2498
    fn = getattr(os, 'fdatasync', getattr(os, 'fsync', None))
 
2499
    if fn is not None:
 
2500
        fn(fileno)