fnametmp[0] = '\0';
return 0;
}
-@@ -225,6 +229,11 @@ static int receive_data(int f_in, char *
- rsyserr(FERROR, errno,
- "lseek failed on %s",
- full_fname(fname));
+@@ -170,6 +174,10 @@ static int receive_data(int f_in, char *
+ if (fd != -1 && (j = do_lseek(fd, offset, SEEK_SET)) != offset) {
+ rsyserr(FERROR, errno, "lseek of %s returned %.0f, not %.0f",
+ full_fname(fname), (double)j, (double)offset);
++#ifdef HAVE_LIBODBC
++ db_log_error(FERROR, 14, "lseek failed on %s",
++ full_fname(fname));
++#endif
+ exit_cleanup(RERR_FILEIO);
+ }
+ }
+@@ -227,6 +235,11 @@ static int receive_data(int f_in, char *
+ "lseek of %s returned %.0f, not %.0f",
+ full_fname(fname),
+ (double)pos, (double)offset);
+#ifdef HAVE_LIBODBC
+ db_log_error(FERROR, 14,
+ "lseek failed on %s",
exit_cleanup(RERR_FILEIO);
}
continue;
-@@ -250,6 +259,9 @@ static int receive_data(int f_in, char *
+@@ -252,6 +265,9 @@ static int receive_data(int f_in, char *
report_write_error:
rsyserr(FERROR, errno, "write failed on %s",
full_fname(fname));
exit_cleanup(RERR_FILEIO);
}
-@@ -293,6 +305,12 @@ static void handle_delayed_updates(struc
+@@ -295,6 +311,12 @@ static void handle_delayed_updates(struc
rsyserr(FERROR, errno,
"rename failed for %s (from %s)",
full_fname(fname), partialptr);
} else {
if (remove_sent_files
|| (preserve_hard_links
-@@ -414,6 +432,9 @@ int recv_files(int f_in, struct file_lis
+@@ -416,6 +438,9 @@ int recv_files(int f_in, struct file_lis
if (server_filter_list.head
&& check_filter(&server_filter_list, fname, 0) < 0) {
rprintf(FERROR, "attempt to hack rsync failed.\n");
+#ifdef HAVE_LIBODBC
-+ db_log_error(FERROR,17,"attempt to hack rsync failed.");
++ db_log_error(FERROR,17,"attempt to hack rsync failed.");
+#endif
exit_cleanup(RERR_PROTOCOL);
}
-@@ -469,6 +490,11 @@ int recv_files(int f_in, struct file_lis
+@@ -471,6 +496,11 @@ int recv_files(int f_in, struct file_lis
rprintf(FERROR,
"invalid basis_dir index: %d.\n",
fnamecmp_type);
exit_cleanup(RERR_PROTOCOL);
}
pathjoin(fnamecmpbuf, sizeof fnamecmpbuf,
-@@ -514,6 +540,9 @@ int recv_files(int f_in, struct file_lis
+@@ -516,6 +546,9 @@ int recv_files(int f_in, struct file_lis
if (fd1 != -1 && do_fstat(fd1,&st) != 0) {
rsyserr(FERROR, errno, "fstat %s failed",
full_fname(fnamecmp));
+#ifdef HAVE_LIBODBC
-+ db_log_error(FERROR, 19,"fstat %s failed",full_fname(fnamecmp));
++ db_log_error(FERROR, 19,"fstat %s failed",full_fname(fnamecmp));
+#endif
discard_receive_data(f_in, file->length);
close(fd1);
continue;
-@@ -527,6 +556,9 @@ int recv_files(int f_in, struct file_lis
+@@ -529,6 +562,9 @@ int recv_files(int f_in, struct file_lis
*/
rprintf(FERROR,"recv_files: %s is a directory\n",
full_fname(fnamecmp));
+#ifdef HAVE_LIBODBC
-+ db_log_error(FERROR,20,"recv_files: %s is a directory",full_fname(fnamecmp));
++ db_log_error(FERROR,20,"recv_files: %s is a directory",full_fname(fnamecmp));
+#endif
discard_receive_data(f_in, file->length);
close(fd1);
continue;
-@@ -550,6 +582,9 @@ int recv_files(int f_in, struct file_lis
+@@ -552,6 +588,9 @@ int recv_files(int f_in, struct file_lis
if (fd2 == -1) {
rsyserr(FERROR, errno, "open %s failed",
full_fname(fname));
+#ifdef HAVE_LIBODBC
-+ db_log_error(FERROR,22, "open %s failed", full_fname(fname));
++ db_log_error(FERROR,22, "open %s failed", full_fname(fname));
+#endif
discard_receive_data(f_in, file->length);
if (fd1 != -1)
close(fd1);
-@@ -583,6 +618,10 @@ int recv_files(int f_in, struct file_lis
+@@ -585,6 +624,10 @@ int recv_files(int f_in, struct file_lis
if (fd2 == -1) {
rsyserr(FERROR, errno, "mkstemp %s failed",
full_fname(fnametmp));
+#ifdef HAVE_LIBODBC
-+ db_log_error(FERROR, 22, "mkstemp %s failed",
++ db_log_error(FERROR, 22, "mkstemp %s failed",
+ full_fname(fnametmp));
+#endif
discard_receive_data(f_in, file->length);
if (fd1 != -1)
close(fd1);
-@@ -605,12 +644,19 @@ int recv_files(int f_in, struct file_lis
+@@ -607,12 +650,19 @@ int recv_files(int f_in, struct file_lis
if (!log_before_transfer)
log_item(file, &initial_stats, iflags, NULL);
exit_cleanup(RERR_FILEIO);
}
-@@ -669,6 +715,12 @@ int recv_files(int f_in, struct file_lis
+@@ -671,6 +721,12 @@ int recv_files(int f_in, struct file_lis
rprintf(msgtype,
"%s: %s failed verification -- update %s%s.\n",
errstr, fname, keptstr, redostr);
+#ifdef HAVE_LIBODBC
-+ db_log_error(msgtype,24,
++ db_log_error(msgtype,24,
+ "%s: %s failed verification -- update %s%s.\n",
+ errstr, fname,
+ keptstr, redostr);