static void logit(int priority, char *buf)
{
if (logfile) {
- fprintf(logfile,"%s %s", timestring(), buf);
+ fprintf(logfile,"%s [%d] %s",
+ timestring(), (int)getpid(), buf);
fflush(logfile);
} else {
syslog(priority, "%s", buf);
}
}
+/* called when the transfer is interrupted for some reason */
+void log_exit(int code)
+{
+ if (code == 0) {
+ extern struct stats stats;
+ rprintf(FLOG,"wrote %.0f bytes read %.0f bytes total size %.0f\n",
+ (double)stats.total_written,
+ (double)stats.total_read,
+ (double)stats.total_size);
+ } else {
+ rprintf(FLOG,"transfer interrupted\n");
+ }
+}
+
/* log the incoming transfer of a file for interactive use, this
will be called at the end where the client was run */
void log_transfer(struct file_struct *file, char *fname)
rprintf(FINFO,"%s\n", fname);
}
+