- if (statret == 0) {
- generate_and_send_sums(fd, st.st_size, f_out, f_copy);
-
- if (f_copy >= 0) {
- close(f_copy);
- set_perms(backupptr, back_file, NULL, 0);
- if (verbose > 1) {
- rprintf(FINFO, "backed up %s to %s\n",
- safe_fname(fname), safe_fname(backupptr));
- }
- free(back_file);
+ if (statret != 0 || whole_file) {
+ write_sum_head(f_out, NULL);
+ return;
+ }
+
+ generate_and_send_sums(fd, st.st_size, f_out, f_copy);
+
+ if (f_copy >= 0) {
+ close(f_copy);
+ set_perms(backupptr, back_file, NULL, 0);
+ if (verbose > 1) {
+ rprintf(FINFO, "backed up %s to %s\n",
+ safe_fname(fname), safe_fname(backupptr));