maroc81 / picocom

Automatically exported from code.google.com/p/picocom
GNU General Public License v2.0
0 stars 1 forks source link

Prevent serial port becoming controlling terminal #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It is possible when calling picocom via another program rather than directly 
from the command line that it will be called without a controlling terminal 
being defined.  My circumstances were the expect program spawning picocom on a 
pseudo-tty in order to talk to an external serial device.

When this happens the first serial port opened will be adopted as picocom's 
controlling tty, and in the case of incorrect baudrate or junk data causes 
picocom to die with SIGHUP or similar.

Adding O_NOCTTY to the serial port open flags corrects this problem.  This will 
be a NOOP in the 99.9% of cases where the user already has a controlling tty.

Patch attached.

Original issue reported on code.google.com by bob.dun...@xyzzy.org.uk on 7 Oct 2011 at 7:55

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed in r25

Original comment by nick.pat...@gmail.com on 21 Feb 2012 at 6:41