+@@ -155,6 +159,9 @@ int open_tmpfile(char *fnametmp, const c
+ if (fd == -1) {
+ rsyserr(FERROR, errno, "mkstemp %s failed",
+ full_fname(fnametmp));
++#ifdef HAVE_LIBODBC
++ db_log_error(FERROR, 22, "mkstemp %s failed", full_fname(fnametmp));
++#endif
+ return -1;
+ }
+
+@@ -213,6 +220,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);
+ }
+ }
+@@ -270,6 +281,11 @@ static int receive_data(int f_in, char *
+ "lseek of %s returned %.0f, not %.0f",
+ full_fname(fname),
+ (double)pos, (double)offset);