+void log_delete(char *fname, int mode)
+{
+ static struct file_struct file;
+ int len = strlen(fname);
+ enum logcode code;
+ char *fmt;
+
+ file.mode = mode;
+ file.basename = fname;
+
+ if (am_server && protocol_version >= 29 && len < MAXPATHLEN) {
+ if (S_ISDIR(mode))
+ len++; /* directories include trailing null */
+ send_msg(MSG_DELETED, fname, len);
+ if (!am_daemon)
+ return;
+ fmt = lp_log_format(module_id);
+ code = FLOG;
+ } else {
+ fmt = log_format && itemize_changes ? log_format : "%i %n";
+ code = FINFO;
+ }
+
+ log_formatted(code, fmt, "del.", &file, &stats, ITEM_DELETED);
+}