return NULL;
}
-static void log_open(void)
+void log_open(void)
{
if (logfname && !logfile) {
extern int orig_umask;
}
}
+void log_close(void)
+{
+ if (logfile) {
+ fclose(logfile);
+ logfile = NULL;
+ }
+}
+
static void logit(int priority, char *buf)
{
if (logfname) {
#endif
}
-void log_close(void)
-{
- if (logfile) {
- fclose(logfile);
- logfile = NULL;
- }
-}
-
/* this is the underlying (unformatted) rsync debugging function. Call
* it with FINFO, FERROR or FLOG */
void rwrite(enum logcode code, char *buf, int len)
struct stats *initial_stats, int iflags)
{
char buf[MAXPATHLEN+1024];
- char buf2[1024];
+ char buf2[MAXPATHLEN];
char *p, *n;
size_t len, total;
int64 b;
break;
case 'n':
n = (char*)safe_fname(f_name(file));
+ if (S_ISDIR(file->mode)) {
+ /* The buffer from safe_fname() has more
+ * room than MAXPATHLEN, so this is safe. */
+ strcat(n, "/");
+ }
break;
case 'L':
if (S_ISLNK(file->mode)) {