In several places:
First is definition of SIGWINCH
Second is open function:
// in FreeBSD, opening a terminal does not cause it
// to become a process's controlling terminal.
// The flag O_NOCTTY is included only for compatibility;.
if (0 != strcmp(strControllingTerminalName, name))
* Slave becomes stdin/stdout/stderr of child.
if (dup2(fds, STDIN_FILENO) != STDIN_FILENO)
perror("dup2 error to stdin");
if (dup2(fds, STDOUT_FILENO) != STDOUT_FILENO)
perror("dup2 error to stdout");
if (dup2(fds, STDERR_FILENO) != STDERR_FILENO)
perror("dup2 error to stderr");
if (fds != STDIN_FILENO &&
fds != STDOUT_FILENO &&
fds != STDERR_FILENO)