Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/net/bpfilter Close pipes on exit.



details:   https://anonhg.NetBSD.org/src/rev/e67fd0a325e0
branches:  trunk
changeset: 781070:e67fd0a325e0
user:      alnsn <alnsn%NetBSD.org@localhost>
date:      Thu Aug 16 20:16:06 2012 +0000

description:
Close pipes on exit.

diffstat:

 tests/net/bpfilter/t_bpfilter.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r 82033f93766a -r e67fd0a325e0 tests/net/bpfilter/t_bpfilter.c
--- a/tests/net/bpfilter/t_bpfilter.c   Thu Aug 16 19:47:48 2012 +0000
+++ b/tests/net/bpfilter/t_bpfilter.c   Thu Aug 16 20:16:06 2012 +0000
@@ -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 <sys/cdefs.h>
-__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 <sys/param.h>
 #include <sys/ioctl.h>
@@ -221,6 +221,8 @@
                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 @@
 
        ATF_CHECK(write(channel[1], "D", 1) == 1);
 
+       close(channel[0]);
+       close(channel[1]);
+
        RL(waitpid(child, &status, 0));
        ATF_CHECK(!WIFSIGNALED(status));
 }



Home | Main Index | Thread Index | Old Index