{
FILE *f=NULL;
extern int am_daemon;
+ extern int am_server;
extern int quiet;
/* recursion can happen with certain fatal conditions */
- if (quiet != 0 && code == FINFO) return;
+ if (quiet && code == FINFO) return;
if (len < 0) exit_cleanup(RERR_MESSAGEIO);
return;
}
- if (io_error_write(log_error_fd, code, buf, strlen(buf))) return;
+ /* first try to pass it off the our sibling */
+ if (am_server && io_error_write(log_error_fd, code, buf, len)) {
+ return;
+ }
+
+ /* then try to pass it to the other end */
+ if (am_server && io_multiplex_write(code, buf, len)) {
+ return;
+ }
if (am_daemon) {
static int depth;
depth++;
log_open();
- if (!io_multiplex_write(code, buf, strlen(buf))) {
- logit(priority, buf);
- }
+ logit(priority, buf);
depth--;
return;
}
if (code == FINFO) {
- extern int am_server;
if (am_server)
f = stderr;
else