diff options
author | jlemon <jlemon@FreeBSD.org> | 2001-02-24 01:33:12 +0000 |
---|---|---|
committer | jlemon <jlemon@FreeBSD.org> | 2001-02-24 01:33:12 +0000 |
commit | fbe6f98d7ed9b99d72f670b6555bac7de196ba8b (patch) | |
tree | 2bfea010a7259d58bb4146fa13955ce546f031c9 | |
parent | 4b6751a6116fcfd0edc668534c944455cf666280 (diff) | |
download | FreeBSD-src-fbe6f98d7ed9b99d72f670b6555bac7de196ba8b.zip FreeBSD-src-fbe6f98d7ed9b99d72f670b6555bac7de196ba8b.tar.gz |
When returning EV_EOF for the socket read/write filters, also return
the current socket error in fflags. This may be useful for determining
why a connect() request fails.
Inspired by: "Jonathan Graehl" <jonathan@graehl.org>
-rw-r--r-- | sys/kern/uipc_socket.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 2f0cdd3..e4c1e9f 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1582,6 +1582,7 @@ filt_soread(struct knote *kn, long hint) kn->kn_data = so->so_rcv.sb_cc; if (so->so_state & SS_CANTRCVMORE) { kn->kn_flags |= EV_EOF; + kn->kn_fflags = so->so_error; return (1); } if (so->so_error) /* temporary udp error */ @@ -1610,6 +1611,7 @@ filt_sowrite(struct knote *kn, long hint) kn->kn_data = sbspace(&so->so_snd); if (so->so_state & SS_CANTSENDMORE) { kn->kn_flags |= EV_EOF; + kn->kn_fflags = so->so_error; return (1); } if (so->so_error) /* temporary udp error */ |