log file and instead sends a FINFO message to the client. This is
used when the daemon wants to log a better message locally than it
is sending to the client. Improved log_delete() to make use of this
idiom if it needs to log a separate delete message for the daemon
and the client.
extern int protocol_version;
extern int preserve_times;
extern int log_format_has_o_or_i;
extern int protocol_version;
extern int preserve_times;
extern int log_format_has_o_or_i;
+extern int daemon_log_format_has_o_or_i;
extern char *auth_user;
extern char *log_format;
extern char *auth_user;
extern char *log_format;
+ if (code == FCLIENT)
+ code = FINFO;
+ else if (am_daemon) {
static int in_block;
char msg[2048];
int priority = code == FERROR ? LOG_WARNING : LOG_INFO;
static int in_block;
char msg[2048];
int priority = code == FERROR ? LOG_WARNING : LOG_INFO;
{
static struct file_struct file;
int len = strlen(fname);
{
static struct file_struct file;
int len = strlen(fname);
char *fmt;
file.mode = mode;
char *fmt;
file.mode = mode;
if (S_ISDIR(mode))
len++; /* directories include trailing null */
send_msg(MSG_DELETED, fname, len);
if (S_ISDIR(mode))
len++; /* directories include trailing null */
send_msg(MSG_DELETED, fname, len);
- if (!am_daemon || dry_run)
- return;
- fmt = lp_log_format(module_id);
- code = FLOG;
} else {
fmt = log_format_has_o_or_i ? log_format : "%i %n";
} else {
fmt = log_format_has_o_or_i ? log_format : "%i %n";
+ log_formatted(FCLIENT, fmt, "del.", &file, &stats, ITEM_DELETED);
- log_formatted(code, fmt, "del.", &file, &stats, ITEM_DELETED);
+ if (!am_daemon || dry_run)
+ return;
+
+ fmt = daemon_log_format_has_o_or_i ? lp_log_format(module_id) : "%i %n";
+ log_formatted(FLOG, fmt, "del.", &file, &stats, ITEM_DELETED);