static struct map_struct *cleanup_buf;
static int cleanup_pid = 0;
-void exit_cleanup(int code)
+void _exit_cleanup(int code, const char *file, int line)
{
extern int keep_partial;
}
}
- if (code) log_exit(code);
+ if (code) log_exit(code, file, line);
exit(code);
}
}
/* called when the transfer is interrupted for some reason */
-void log_exit(int code)
+void log_exit(int code, const char *file, int line)
{
if (code == 0) {
extern struct stats stats;
(double)stats.total_read,
(double)stats.total_size);
} else {
- rprintf(FLOG,"transfer interrupted (code %d)\n", code);
+ rprintf(FLOG,"transfer interrupted (code %d) at %s(%d)\n",
+ code, file, line);
}
}
it i called when a file starts to be transferred
*/
-void log_transfer(struct file_struct *file, char *fname)
+void log_transfer(struct file_struct *file, const char *fname)
{
extern int verbose;
extern int do_stats;
if (am_daemon) {
- log_exit(0);
+ log_exit(0, __FILE__, __LINE__);
if (f == -1 || !am_sender) return;
}
size_t strlcat(char *d, const char *s, size_t bufsize);
#endif
+#define exit_cleanup(code) _exit_cleanup(code, __FILE__, __LINE__)