Lines Matching refs:fds
42 unsafe fn bail(fdm: ::c_int, fds: ::c_int) -> ::c_int { in bail()
44 if fds >= 0 { in bail()
45 ::close(fds); in bail()
81 let fds = ::open(subordpath, O_RDWR | O_NOCTTY); in openpty() localVariable
82 if fds < 0 { in openpty()
87 let setup = ::ioctl(fds, I_FIND, LDTERM.as_ptr()); in openpty()
89 return bail(fdm, fds); in openpty()
93 if ::ioctl(fds, I_PUSH, PTEM.as_ptr()) < 0 || ::ioctl(fds, I_PUSH, LDTERM.as_ptr()) < 0 { in openpty()
94 return bail(fdm, fds); in openpty()
99 if !termp.is_null() && ::tcsetattr(fds, TCSAFLUSH, termp) != 0 { in openpty()
100 return bail(fdm, fds); in openpty()
104 if !winp.is_null() && ::ioctl(fds, TIOCSWINSZ, winp) < 0 { in openpty()
105 return bail(fdm, fds); in openpty()
118 *asubord = fds; in openpty()
128 let mut fds = -1; in forkpty() localVariable
130 if openpty(amain, &mut fds, name, termp, winp) != 0 { in forkpty()
136 return bail(*amain, fds); in forkpty()
140 ::close(fds); in forkpty()
154 || ::ioctl(fds, TIOCSCTTY, 0) < 0 in forkpty()
155 || ::dup2(fds, 0) < 0 in forkpty()
156 || ::dup2(fds, 1) < 0 in forkpty()
157 || ::dup2(fds, 2) < 0 in forkpty()
166 if fds > 2 { in forkpty()
167 ::close(fds); in forkpty()