summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Bex <peter@more-magic.net>2013-05-07 19:23:12 +0200
committerPeter Bex <peter@more-magic.net>2016-03-04 21:38:49 +0100
commit5a9446604f9fea441fd20d3c37eace5329307ab4 (patch)
tree4e031f82637ee5b14cab577b6cea3d9a22ea682e
parentb2cae3951f390ebd0e75cf5a7c668b4f90eb81ce (diff)
downloadbpf-5a9446604f9fea441fd20d3c37eace5329307ab4.tar.gz
Don't try to print details of closed BPF objects
-rw-r--r--bpf-interface.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/bpf-interface.scm b/bpf-interface.scm
index 5a3be0c..3f9e47a 100644
--- a/bpf-interface.scm
+++ b/bpf-interface.scm
@@ -51,7 +51,9 @@
(define-record bpf fd)
(define-record-printer (bpf obj out)
- (fprintf out "#<bpf on interface: ~S>" (bpf-interface obj)))
+ (if (bpf-fd obj)
+ (fprintf out "#<bpf on interface: ~S>" (bpf-interface obj))
+ (display "#<bpf (closed)>" out)))
(define (bpf-open interface #!optional buffer-length)
(let lp ((i -1)