Source-Changes-HG archive

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

[src/trunk]: src/tests/lib/libc/ttyio PR/51803: Ngie Cooper: CID 978321: Don'...



details:   https://anonhg.NetBSD.org/src/rev/f9b4df57f0a9
branches:  trunk
changeset: 350298:f9b4df57f0a9
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jan 10 01:31:40 2017 +0000

description:
PR/51803: Ngie Cooper: CID 978321: Don't leak openpty() fd.

diffstat:

 tests/lib/libc/ttyio/t_ttyio.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 3436b6660e68 -r f9b4df57f0a9 tests/lib/libc/ttyio/t_ttyio.c
--- a/tests/lib/libc/ttyio/t_ttyio.c    Tue Jan 10 01:29:31 2017 +0000
+++ b/tests/lib/libc/ttyio/t_ttyio.c    Tue Jan 10 01:31:40 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_ttyio.c,v 1.2 2011/04/19 20:07:53 martin Exp $ */
+/*     $NetBSD: t_ttyio.c,v 1.3 2017/01/10 01:31:40 christos Exp $ */
 
 /*
  * Copyright (c) 2001, 2008 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include <sys/cdefs.h>
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_ttyio.c,v 1.2 2011/04/19 20:07:53 martin Exp $");
+__RCSID("$NetBSD: t_ttyio.c,v 1.3 2017/01/10 01:31:40 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -150,8 +150,9 @@
        /* wait for last child */
        sa.sa_handler = SIG_DFL;
        REQUIRE_ERRNO(sigaction(SIGCHLD, &sa, NULL), -1);
-       (void) wait(NULL);
+       (void)wait(NULL);
 
+       (void)close(s);
        ATF_REQUIRE_EQ(rc, 0);
 }
 



Home | Main Index | Thread Index | Old Index