From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on sa.int.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:received:from:to:subject:date:message-id:x-mailer:mime-version:content-type:content-transfer-encoding; bh=/s7tThqdBetjzsnf+ZfSOmXKABLRFE75eSYvMUW6a8M=; b=O1unlW2s+FwhR1t8dXntQ5Hxwqg7OFMxy02KKfD1BrbXiSAE9u2wYwpxOuA9lIPA/VkZXeueFGTMYua/iKwaOQiOoKWVMHHkkdBZ6JlNGbcwEkU6LFHUa+de8eDXytJNn7/3lXUL3xxp49awHDOImA3/bQ6bA/g29Q76bbnkWjE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=from:to:subject:date:message-id:x-mailer:mime-version:content-type:content-transfer-encoding; b=HvBrMt4RQvXeftsWfaSpMSWf2RCOBL5P7ei70iOsM+SSY31djsbeZWGRnqOGwfZH0fivsVB9MGce+9GJOnBQG9c1fwQ5nRihiVQ4WEBJeGHUkw1C2X363Fxm2M0TvNpC4uzmHnRdp9JQlRiYxDtOSygzlhtyUMsI8pl19jNDZBs= From: Michael Schutte To: kbd@lists.altlinux.org Date: Mon, 24 Mar 2008 16:35:30 +0100 Message-Id: <1206372930-6971-1-git-send-email-m.schutte.jr@gmail.com> X-Mailer: git-send-email 1.5.4.4 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: [kbd] [PATCH] src/openvt.c: Close fd0 in parent after child has returned X-BeenThere: kbd@lists.altlinux.org X-Mailman-Version: 2.1.10b3 Precedence: list Reply-To: Linux console tools development discussion List-Id: Linux console tools development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2008 15:35:49 -0000 Archived-At: List-Archive: The race condition fix (commit 9d987…) introduces a regression which causes the parent to leave open the file descriptor pointing to the VT opened. This causes VT_DISALLOCATE to fail with an EBUSY error. Fixed by closing fd0 in the do_wait stanza. Signed-off-by: Michael Schutte --- src/openvt.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/openvt.c b/src/openvt.c index ffd0570..5e4443b 100644 --- a/src/openvt.c +++ b/src/openvt.c @@ -304,6 +304,8 @@ got_vtno: if ( do_wait ) { wait(&status); + if (!direct_exec) + close(fd0); if (show) { /* Switch back... */ if (ioctl(consfd, VT_ACTIVATE, vtstat.v_active)) { perror("VT_ACTIVATE"); -- 1.5.4.4