diff options
author | Martin Mares <mj@ucw.cz> | 2000-05-02 16:10:04 +0000 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2000-05-02 16:10:04 +0000 |
commit | 53943a002265d8e2b6a887eaa497a01840675693 (patch) | |
tree | 66897b24d24a3840d880c11f89a208981c23bf9e /proto/bgp/bgp.c | |
parent | 85368cd4b7244535f6ce56a27f6d22ddfa2bf4e6 (diff) |
Defined format specifier `%M' which behaves as `%m', but takes the
error code as an argument.
Use it in socket hooks where we really shouldn't rely on errno containing
the right value or even existing.
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r-- | proto/bgp/bgp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index 4a68f04b..41081f26 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -158,7 +158,10 @@ bgp_sock_err(sock *sk, int err) struct bgp_conn *conn = sk->data; struct bgp_proto *p = conn->bgp; - BGP_TRACE(D_EVENTS, "Connection closed (socket error %d)", err); + if (err) + BGP_TRACE(D_EVENTS, "Connection lost (%M)", err); + else + BGP_TRACE(D_EVENTS, "Connection closed"); switch (conn->state) { case BS_CONNECT: |