setsid();
// This line makes the ptty our controlling tty. We do not otherwise need it open
slavept=open(name, O_RDWR );
if ( ioctl(slavept, TIOCSCTTY, NULL) ) {
perror("sshpass: Failed to recover the controlling tty");
}
close( slavept );
close( masterpt );