diff options
author | Rich Felker <dalias@aerifal.cx> | 2014-12-21 02:10:51 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2014-12-21 02:10:51 -0500 |
commit | 814aae20093879dec36df0302febbafae2a66778 (patch) | |
tree | 07e7a187118d6e0fb1006ff1afaf6bc930d63251 /src/termios | |
parent | 1227e418eafbbe55e74eee5d2b1e6e53a60102cd (diff) | |
download | musl-814aae20093879dec36df0302febbafae2a66778.tar.gz musl-814aae20093879dec36df0302febbafae2a66778.tar.xz musl-814aae20093879dec36df0302febbafae2a66778.zip |
overhaul forkpty function using new login_tty
based on discussion with and patches by Felix Janda. these changes started as an effort to factor forkpty in terms of login_tty, which returns an error and skips fd reassignment and closing if setting the controlling terminal failed. the previous forkpty code was unable to handle errors in the child, and did not attempt to; it just silently ignored them. but this would have been unacceptable when switching to using login_tty, since the child would start with the wrong stdin, stdout, and stderr and thereby clobber the parent's files. the new code uses the same technique as the posix_spawn implementation to convey any possible error in the child to the parent so that the parent can report failure to the caller. it is also safe against thread cancellation and against signal delivery in the child prior to the determination of success.
Diffstat (limited to 'src/termios')
0 files changed, 0 insertions, 0 deletions