From d52ebd2ff5961c4aa251dff75ec88ab94a7d230c Mon Sep 17 00:00:00 2001 From: alnsn Date: Thu, 16 Aug 2012 20:16:06 +0000 Subject: [PATCH] Close pipes on exit. --- tests/net/bpfilter/t_bpfilter.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/net/bpfilter/t_bpfilter.c b/tests/net/bpfilter/t_bpfilter.c index fba1b94d3c2c..7502fff66861 100644 --- a/tests/net/bpfilter/t_bpfilter.c +++ b/tests/net/bpfilter/t_bpfilter.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_bpfilter.c,v 1.3 2012/08/16 19:42:23 alnsn Exp $ */ +/* $NetBSD: t_bpfilter.c,v 1.4 2012/08/16 20:16:06 alnsn Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -25,7 +25,7 @@ * SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_bpfilter.c,v 1.3 2012/08/16 19:42:23 alnsn Exp $"); +__RCSID("$NetBSD: t_bpfilter.c,v 1.4 2012/08/16 20:16:06 alnsn Exp $"); #include #include @@ -221,6 +221,8 @@ magic_ping_test(const char *name, unsigned int wirelen) netcfg_rump_if(ifr.ifr_name, "10.1.1.10", "255.0.0.0"); ATF_CHECK(write(channel[1], "U", 1) == 1); ATF_CHECK(read(channel[0], &token, 1) == 1 && token == 'D'); + close(channel[0]); + close(channel[1]); return; default: break; @@ -261,6 +263,9 @@ magic_ping_test(const char *name, unsigned int wirelen) ATF_CHECK(write(channel[1], "D", 1) == 1); + close(channel[0]); + close(channel[1]); + RL(waitpid(child, &status, 0)); ATF_CHECK(!WIFSIGNALED(status)); }