Source-Changes-HG archive

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

[src/trunk]: src/tests/lib/libc/gen PR/51809: Ngie Cooper: fix file descripto...



details:   https://anonhg.NetBSD.org/src/rev/c16cd3b86cb3
branches:  trunk
changeset: 820476:c16cd3b86cb3
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jan 10 15:19:52 2017 +0000

description:
PR/51809: Ngie Cooper: fix file descriptor leak

diffstat:

 tests/lib/libc/gen/t_ftok.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 8c97827b2eec -r c16cd3b86cb3 tests/lib/libc/gen/t_ftok.c
--- a/tests/lib/libc/gen/t_ftok.c       Tue Jan 10 15:19:00 2017 +0000
+++ b/tests/lib/libc/gen/t_ftok.c       Tue Jan 10 15:19:52 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_ftok.c,v 1.1 2011/11/08 05:47:00 jruoho Exp $ */
+/*     $NetBSD: t_ftok.c,v 1.2 2017/01/10 15:19:52 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_ftok.c,v 1.1 2011/11/08 05:47:00 jruoho Exp $");
+__RCSID("$NetBSD: t_ftok.c,v 1.2 2017/01/10 15:19:52 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/ipc.h>
@@ -68,6 +68,7 @@
        fd = open(path, O_RDONLY | O_CREAT);
 
        ATF_REQUIRE(fd >= 0);
+       (void)close(fd);
        ATF_REQUIRE(link(path, hlnk) == 0);
        ATF_REQUIRE(symlink(path, slnk) == 0);
 



Home | Main Index | Thread Index | Old Index