Source-Changes-HG archive

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

[src/trunk]: src/tests/lib/libc/c063 PR misc/54939: fix file descriptor leak, ...



details:   https://anonhg.NetBSD.org/src/rev/c12c686e57a8
branches:  trunk
changeset: 744534:c12c686e57a8
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Feb 05 08:52:46 2020 +0000

description:
PR misc/54939: fix file descriptor leak, patch from Kyle Evans.

diffstat:

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

diffs (26 lines):

diff -r c577f3b2d0e9 -r c12c686e57a8 tests/lib/libc/c063/t_o_search.c
--- a/tests/lib/libc/c063/t_o_search.c  Wed Feb 05 08:36:56 2020 +0000
+++ b/tests/lib/libc/c063/t_o_search.c  Wed Feb 05 08:52:46 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_o_search.c,v 1.6 2020/01/28 07:12:08 martin Exp $ */
+/*     $NetBSD: t_o_search.c,v 1.7 2020/02/05 08:52:46 martin Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_o_search.c,v 1.6 2020/01/28 07:12:08 martin Exp $");
+__RCSID("$NetBSD: t_o_search.c,v 1.7 2020/02/05 08:52:46 martin Exp $");
 
 #include <atf-c.h>
 
@@ -260,6 +260,7 @@
        ATF_REQUIRE((dfd = open(FILE, O_CREAT|O_RDWR|O_SEARCH, 0644)) != -1);
        ATF_REQUIRE((fd = openat(dfd, BASEFILE, O_RDWR, 0)) == -1);
        ATF_REQUIRE(errno == ENOTDIR);
+       ATF_REQUIRE(close(dfd) == 0);
 }
 
 ATF_TP_ADD_TCS(tp)



Home | Main Index | Thread Index | Old Index