diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2012-08-08 17:28:37 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2012-08-08 17:28:37 +0000 |
commit | 11cf5b7a45dd0665885c5b6b7fb995707678cc96 (patch) | |
tree | 9a90e2e2883bf80db941735b49bde70389d43219 /usr.sbin/smtpd/smtpd.c | |
parent | bda26feaea1b2fd33b14ccb8c01eb83871c81efe (diff) |
log received fd in log_imsg() if any
ok gilles@ chl@
Diffstat (limited to 'usr.sbin/smtpd/smtpd.c')
-rw-r--r-- | usr.sbin/smtpd/smtpd.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c index 8505b5e13f0..7fbbe7045fe 100644 --- a/usr.sbin/smtpd/smtpd.c +++ b/usr.sbin/smtpd/smtpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.c,v 1.155 2012/07/09 17:57:54 gilles Exp $ */ +/* $OpenBSD: smtpd.c,v 1.156 2012/08/08 17:28:36 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -1159,11 +1159,19 @@ SPLAY_GENERATE(childtree, child, entry, child_cmp); void log_imsg(int to, int from, struct imsg *imsg) { - log_trace(TRACE_IMSG, "imsg: %s <- %s: %s (len=%zu)", - proc_to_str(to), - proc_to_str(from), - imsg_to_str(imsg->hdr.type), - imsg->hdr.len - IMSG_HEADER_SIZE); + if (imsg->fd != -1) + log_trace(TRACE_IMSG, "imsg: %s <- %s: %s (len=%zu, fd=%i)", + proc_to_str(to), + proc_to_str(from), + imsg_to_str(imsg->hdr.type), + imsg->hdr.len - IMSG_HEADER_SIZE, + imsg->fd); + else + log_trace(TRACE_IMSG, "imsg: %s <- %s: %s (len=%zu)", + proc_to_str(to), + proc_to_str(from), + imsg_to_str(imsg->hdr.type), + imsg->hdr.len - IMSG_HEADER_SIZE); } #define CASE(x) case x : return #x |