Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Die if we sent --max-delete=0 to a receiving side that is too old.
[rsync/rsync.git]
/
log.c
diff --git
a/log.c
b/log.c
index
ef91f98
..
3da7b9f
100644
(file)
--- a/
log.c
+++ b/
log.c
@@
-37,7
+37,6
@@
extern int msg_fd_out;
extern int allow_8bit_chars;
extern int protocol_version;
extern int preserve_times;
extern int allow_8bit_chars;
extern int protocol_version;
extern int preserve_times;
-extern int in_exit_cleanup;
extern int stdout_format_has_i;
extern int stdout_format_has_o_or_i;
extern int logfile_format_has_i;
extern int stdout_format_has_i;
extern int stdout_format_has_o_or_i;
extern int logfile_format_has_i;
@@
-91,14
+90,6
@@
struct {
{ 0, NULL }
};
{ 0, NULL }
};
-#define EXIT_OR_RETURN(err) \
- do { \
- if (in_exit_cleanup) \
- return; \
- exit_cleanup(err); \
- } while (0)
-
-
/*
* Map from rsync error code to name, or return NULL.
*/
/*
* Map from rsync error code to name, or return NULL.
*/
@@
-223,20
+214,20
@@
static void filtered_fwrite(FILE *f, const char *buf, int len, int use_isprint)
for (s = buf; s < end; s++) {
if ((s < end - 4
&& *s == '\\' && s[1] == '#'
for (s = buf; s < end; s++) {
if ((s < end - 4
&& *s == '\\' && s[1] == '#'
- && is
digit(*(uchar*)(s+2)
)
- && is
digit(*(uchar*)(s+3)
)
- && is
digit(*(uchar*)(s+4)
))
+ && is
Digit(s + 2
)
+ && is
Digit(s + 3
)
+ && is
Digit(s + 4
))
|| (*s != '\t'
|| (*s != '\t'
- && ((use_isprint && !is
print(*(uchar*)
s))
+ && ((use_isprint && !is
Print(
s))
|| *(uchar*)s < ' '))) {
if (s != buf && fwrite(buf, s - buf, 1, f) != 1)
|| *(uchar*)s < ' '))) {
if (s != buf && fwrite(buf, s - buf, 1, f) != 1)
-
EXIT_OR_RETURN
(RERR_MESSAGEIO);
+
exit_cleanup
(RERR_MESSAGEIO);
fprintf(f, "\\#%03o", *(uchar*)s);
buf = s + 1;
}
}
if (buf != end && fwrite(buf, end - buf, 1, f) != 1)
fprintf(f, "\\#%03o", *(uchar*)s);
buf = s + 1;
}
}
if (buf != end && fwrite(buf, end - buf, 1, f) != 1)
-
EXIT_OR_RETURN
(RERR_MESSAGEIO);
+
exit_cleanup
(RERR_MESSAGEIO);
}
/* this is the underlying (unformatted) rsync debugging function. Call
}
/* this is the underlying (unformatted) rsync debugging function. Call
@@
-248,7
+239,7
@@
void rwrite(enum logcode code, char *buf, int len)
FILE *f = NULL;
if (len < 0)
FILE *f = NULL;
if (len < 0)
-
EXIT_OR_RETURN
(RERR_MESSAGEIO);
+
exit_cleanup
(RERR_MESSAGEIO);
if (am_server && msg_fd_out >= 0) {
/* Pass the message to our sibling. */
if (am_server && msg_fd_out >= 0) {
/* Pass the message to our sibling. */
@@
-302,7
+293,7
@@
void rwrite(enum logcode code, char *buf, int len)
f = am_server ? stderr : stdout;
break;
default:
f = am_server ? stderr : stdout;
break;
default:
-
EXIT_OR_RETURN
(RERR_MESSAGEIO);
+
exit_cleanup
(RERR_MESSAGEIO);
}
trailing_CR_or_NL = len && (buf[len-1] == '\n' || buf[len-1] == '\r')
}
trailing_CR_or_NL = len && (buf[len-1] == '\n' || buf[len-1] == '\r')
@@
-406,7
+397,7
@@
void rsyserr(enum logcode code, int errcode, const char *format, ...)
": %s (%d)\n", strerror(errcode), errcode);
}
if (len >= sizeof buf)
": %s (%d)\n", strerror(errcode), errcode);
}
if (len >= sizeof buf)
-
EXIT_OR_RETURN
(RERR_MESSAGEIO);
+
exit_cleanup
(RERR_MESSAGEIO);
rwrite(code, buf, len);
}
rwrite(code, buf, len);
}
@@
-444,7
+435,7
@@
static void log_formatted(enum logcode code, char *format, char *op,
total = strlcpy(buf, format, sizeof buf);
if (total > MAXPATHLEN) {
rprintf(FERROR, "log-format string is WAY too long!\n");
total = strlcpy(buf, format, sizeof buf);
if (total > MAXPATHLEN) {
rprintf(FERROR, "log-format string is WAY too long!\n");
-
EXIT_OR_RETURN
(RERR_MESSAGEIO);
+
exit_cleanup
(RERR_MESSAGEIO);
}
buf[total++] = '\n';
buf[total] = '\0';
}
buf[total++] = '\n';
buf[total] = '\0';
@@
-454,7
+445,7
@@
static void log_formatted(enum logcode code, char *format, char *op,
n = fmt + 1;
if (*p == '-')
*n++ = *p++;
n = fmt + 1;
if (*p == '-')
*n++ = *p++;
- while (is
digit(*(uchar*)
p) && n - fmt < (int)(sizeof fmt) - 8)
+ while (is
Digit(
p) && n - fmt < (int)(sizeof fmt) - 8)
*n++ = *p++;
if (!*p)
break;
*n++ = *p++;
if (!*p)
break;
@@
-623,8
+614,7
@@
static void log_formatted(enum logcode code, char *format, char *op,
int i;
for (i = 2; n[i]; i++)
n[i] = ch;
int i;
for (i = 2; n[i]; i++)
n[i] = ch;
- } else if (n[0] == '.' || n[0] == 'h'
- || (n[0] == 'c' && n[1] == 'f')) {
+ } else if (n[0] == '.' || n[0] == 'h' || n[0] == 'c') {
int i;
for (i = 2; n[i]; i++) {
if (n[i] != '.')
int i;
for (i = 2; n[i]; i++) {
if (n[i] != '.')
@@
-655,7
+645,7
@@
static void log_formatted(enum logcode code, char *format, char *op,
rprintf(FERROR,
"buffer overflow expanding %%%c -- exiting\n",
p[0]);
rprintf(FERROR,
"buffer overflow expanding %%%c -- exiting\n",
p[0]);
-
EXIT_OR_RETURN
(RERR_MESSAGEIO);
+
exit_cleanup
(RERR_MESSAGEIO);
}
/* Shuffle the rest of the string along to make space for n */
}
/* Shuffle the rest of the string along to make space for n */
@@
-686,7
+676,7
@@
int log_format_has(const char *format, char esc)
for (p = format; (p = strchr(p, '%')) != NULL; ) {
if (*++p == '-')
p++;
for (p = format; (p = strchr(p, '%')) != NULL; ) {
if (*++p == '-')
p++;
- while (is
digit(*(uchar*)
p))
+ while (is
Digit(
p))
p++;
if (!*p)
break;
p++;
if (!*p)
break;