{ RERR_WAITCHILD , "some error returned by waitpid()" },
{ RERR_MALLOC , "error allocating core memory buffers" },
{ RERR_PARTIAL , "some files could not be transferred" },
- { RERR_VANISHED , "some files vanished before they could be transfered" },
+ { RERR_VANISHED , "some files vanished before they could be transferred" },
{ RERR_TIMEOUT , "timeout in data send/receive" },
{ RERR_CMD_FAILED , "remote shell failed" },
{ RERR_CMD_KILLED , "remote shell killed" },
return NULL;
}
+static void log_open(void)
+{
+ if (logfname && !logfile) {
+ extern int orig_umask;
+ int old_umask = umask(022 | orig_umask);
+ logfile = fopen(logfname, "a");
+ umask(old_umask);
+ if (!logfile) {
+ am_daemon = 0; /* avoid trying to log again */
+ rsyserr(FERROR, errno, "fopen() of log-file failed");
+ exit_cleanup(RERR_FILESELECT);
+ }
+ }
+}
static void logit(int priority, char *buf)
{
#endif
}
-void log_open(void)
-{
- if (logfname && !logfile) {
- extern int orig_umask;
- int old_umask = umask(022 | orig_umask);
- logfile = fopen(logfname, "a");
- umask(old_umask);
- }
-}
-
void log_close(void)
{
if (logfile) {
case 'o': n = op; break;
case 'f':
pathjoin(buf2, sizeof buf2,
- file->basedir ? file->basedir : "",
- f_name(file));
- clean_fname(buf2);
+ am_sender && file->dir.root ? file->dir.root : "",
+ f_name(file));
+ clean_fname(buf2, 0);
n = buf2;
if (*n == '/') n++;
break;
l = strlen(n);
if (l + ((int)(s - &buf[0])) >= sizeof(buf)) {
- rprintf(FERROR,"buffer overflow expanding %%%c - exiting\n",
+ rprintf(FERROR,"buffer overflow expanding %%%c -- exiting\n",
p[0]);
exit_cleanup(RERR_MESSAGEIO);
}