Bug 4455 - fsync called after closing file
Summary: fsync called after closing file
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.0.0
Hardware: Other Linux
: P3 major (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
Depends on:
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.