From a6a4e428ddcfd7010d9ed04346190a6ef70a2aed Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 25 Feb 2017 17:10:42 -0800 Subject: Support setting non-blocking mode before activating. We just set a flag and attempt to set non-blocking mode after activating. If a module can't support non-blocking mode, it should set the set non-blocking operator in the create routine, so a pre-activation call will fail the same way a post-activation call fails. While we're at it: Have the get non-blocking and set non-blocking modes not take an error buffer as an argument; they have the error buffer in the pcap_t to set. pcap_getnonblock() and pcap_setnonblock() just copy the error from there to the argument passed in. Make sure we set the cleanup op pointer when appropriate. --- pcap-dbus.c | 1 + 1 file changed, 1 insertion(+) (limited to 'pcap-dbus.c') diff --git a/pcap-dbus.c b/pcap-dbus.c index 41f50411..ea3a390f 100644 --- a/pcap-dbus.c +++ b/pcap-dbus.c @@ -211,6 +211,7 @@ dbus_activate(pcap_t *handle) handle->getnonblock_op = pcap_getnonblock_fd; handle->setnonblock_op = pcap_setnonblock_fd; handle->stats_op = dbus_stats; + handle->cleanup_op = dbus_cleanup; handle->selectable_fd = handle->fd = -1; -- cgit v1.2.3