OSDN Git Service

forkpty: set the output fd to -1 on the slave side.
authorJosh Gao <jmgao@google.com>
Sat, 5 Mar 2016 02:04:41 +0000 (18:04 -0800)
committerJosh Gao <jmgao@google.com>
Sat, 5 Mar 2016 03:16:43 +0000 (19:16 -0800)
commitbf4c113cad4d1f4464867a057d5c703505ef32b2
tree3d5a737fdf498fcf68b00c158ddf86d6a2068c1f
parent8dd7c611ea9889b316c02861d463edee83c6a207
forkpty: set the output fd to -1 on the slave side.

glibc, FreeBSD, OpenBSD, and Darwin all just leave the fd unchanged and
possibly uninitialized. Setting it to -1 seems friendlier, though.

Bug: http://b/27506278
Change-Id: I7acdc8eecbea4404d5fb4ba0b4d572245a323886
libc/bionic/pty.cpp