Bug 4455 - fsync called after closing file
fsync called after closing file
Product: rsync
Classification: Unclassified
Component: core
Other Linux
: P3 major
: ---
Assigned To: Wayne Davison
Rsync QA Contact
Depends on:
  Show dependency treegraph
Reported: 2007-03-19 15:32 UTC by Sami Farin
Modified: 2008-07-26 10:06 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Sami Farin 2007-03-19 15:32:43 UTC
You broke my patch I submitted in 2003(?).

Now in copy_file() with fsync.diff, rsync first does
close(ofd) and then fsync(ofd).
fsync should be done first.

The other (more common) fsync call in receive_data() is OK.
Comment 1 Sami Farin 2007-03-20 06:40:04 UTC
In case fsync(ofd) fails, close(ofd) is not called.
It should do (void)close(ofd) just before "return -1".
Comment 2 Wayne Davison 2007-03-20 12:09:30 UTC
Thanks.  I've checked in these changes.