aboutsummaryrefslogtreecommitdiff
path: root/pcap-dbus.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-02-25 17:10:42 -0800
committerGuy Harris <guy@alum.mit.edu>2017-02-25 17:10:42 -0800
commita6a4e428ddcfd7010d9ed04346190a6ef70a2aed (patch)
treedf72110b06a520c58e66da45e5fe999910eb10d4 /pcap-dbus.c
parent1bd5003a2966cd520e661b881e95b6317d56d5a2 (diff)
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.
Diffstat (limited to 'pcap-dbus.c')
-rw-r--r--pcap-dbus.c1
1 files changed, 1 insertions, 0 deletions
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;