From 6cf4b26e813f850a520b32d564cfb2b298a1bfc9 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Tue, 20 Mar 2007 17:09:09 +0000 Subject: [PATCH] Close the output fd when fsync() fails on it. --- fsync.diff | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fsync.diff b/fsync.diff index 276c454..9877bcb 100644 --- a/fsync.diff +++ b/fsync.diff @@ -86,13 +86,14 @@ To use this patch, run these commands for a successful build: extern int modify_window; extern int relative_paths; extern int human_readable; -@@ -309,6 +310,12 @@ int copy_file(const char *source, const +@@ -309,6 +310,13 @@ int copy_file(const char *source, const full_fname(source)); } + if (do_fsync && fsync(ofd) < 0) { + rsyserr(FERROR, errno, "fsync failed on %s", + full_fname(dest)); ++ close(ofd); + return -1; + } + -- 2.34.1