From owner-svn-src-head@FreeBSD.ORG Sun May 31 19:43:36 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B480818F; Sun, 31 May 2015 19:43:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A20DA12B9; Sun, 31 May 2015 19:43:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4VJhaDA041979; Sun, 31 May 2015 19:43:36 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4VJhand041978; Sun, 31 May 2015 19:43:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201505311943.t4VJhand041978@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 31 May 2015 19:43:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283836 - head/tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2015 19:43:36 -0000 Author: jhb Date: Sun May 31 19:43:35 2015 New Revision: 283836 URL: https://svnweb.freebsd.org/changeset/base/283836 Log: Consistently only use one end of the pipe in the parent and debugger processes and do not rely on EOF due to a close() in the debugger. PR: 200489 Differential Revision: https://reviews.freebsd.org/D2674 Reviewed by: kib, ngie, rodrigc Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Sun May 31 19:09:24 2015 (r283835) +++ head/tests/sys/kern/ptrace_test.c Sun May 31 19:43:35 2015 (r283836) @@ -304,7 +304,7 @@ ATF_TC_BODY(ptrace__parent_sees_exit_aft ATF_REQUIRE(write(dpipe[1], &c, sizeof(c)) == sizeof(c)); /* Wait for parent's failed wait. */ - ATF_REQUIRE(read(dpipe[1], &c, sizeof(c)) == 0); + ATF_REQUIRE(read(dpipe[1], &c, sizeof(c)) == sizeof(c)); wpid = waitpid(child, &status, 0); ATF_REQUIRE(wpid == child); @@ -313,6 +313,7 @@ ATF_TC_BODY(ptrace__parent_sees_exit_aft exit(0); } + close(dpipe[1]); /* Parent process. */ @@ -365,10 +366,11 @@ ATF_TC_BODY(ptrace__parent_sees_exit_aft ATF_REQUIRE(wpid == 0); /* Signal the debugger to wait for the child. */ - close(dpipe[0]); + ATF_REQUIRE(write(dpipe[0], &c, sizeof(c)) == sizeof(c)); /* Wait for the debugger. */ - ATF_REQUIRE(read(dpipe[1], &c, sizeof(c)) == 0); + ATF_REQUIRE(read(dpipe[0], &c, sizeof(c)) == 0); + close(dpipe[0]); /* The child process should now be ready. */ wpid = waitpid(child, &status, WNOHANG);