[haiku-bugs] Re: [Haiku] #3417: tcsetpgrp() causes the shell "bsh" to hang infinitely while trying to set tty process group

  • From: "simonsouth" <trac@xxxxxxxxxxxx>
  • Date: Wed, 07 Oct 2015 18:35:15 -0000

#3417: tcsetpgrp() causes the shell "bsh" to hang infinitely while trying to set
tty process group
-------------------------+---------------------------
Reporter: schily | Owner: axeld
Type: bug | Status: new
Priority: normal | Milestone: R1
Component: - General | Version: R1/pre-alpha1
Resolution: | Keywords:
Blocked By: | Blocking:
Has a Patch: 1 | Platform: All
-------------------------+---------------------------

Comment (by simonsouth):

I've added a patch that should fix this problem.

When a member of a background process group tries to change the foreground
process group of its controlling terminal,
[http://pubs.opengroup.org/onlinepubs/9699919799/functions/tcsetpgrp.html
POSIX says] SIGTTOU should be sent unless the process is ignoring it or
the calling thread is blocking it. The existing code checked the former
case but not the latter, which meant the calling thread could get stuck in
a loop while the system call was continually restarted.

--
Ticket URL: <https://dev.haiku-os.org/ticket/3417#comment:2>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: