Skip to contentSkip to conversation

src/openvt.c: Close fd0 in parent after child has returned

PATCH In review Michael Schutte 2 participants 2 messages Mar 24, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 src/openvt.c: Close fd0 in parent after child has returned

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.

---
 src/openvt.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
src/openvt.c +2 -0
index ffd0570..5e4443b 100644
@@ -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");
Signature · 1 line
1.5.4.4
#1 lore raw
Quoted 7 lines · Michael Schutte

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.

Thanks!

But this patch is not for 1.14.1 branch.
This bug is fixed already.

Signature · 1 line
Rgrds, legion