Diff

Differences From Artifact [b2775501ad]:

To Artifact [bdb3540503]:


356
357
358
359
360
361
362
363
364


365
366
367
368
369
370
371
    strncpy(pty->name, ptsname(pty->master_fd), FILENAME_MAX-1);
#endif

    {
        /*
         * Set the pty master into non-blocking mode.
         */
        int i = 1;
        ioctl(pty->master_fd, FIONBIO, &i);


    }

    if (!ptys_by_fd)
	ptys_by_fd = newtree234(pty_compare_by_fd);
    add234(ptys_by_fd, pty);
}








|
|
>
>







356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
    strncpy(pty->name, ptsname(pty->master_fd), FILENAME_MAX-1);
#endif

    {
        /*
         * Set the pty master into non-blocking mode.
         */
        int fl;
	fl = fcntl(pty->master_fd, F_GETFL);
	if (fl != -1 && !(fl & O_NONBLOCK))
	    fcntl(pty->master_fd, F_SETFL, fl | O_NONBLOCK);
    }

    if (!ptys_by_fd)
	ptys_by_fd = newtree234(pty_compare_by_fd);
    add234(ptys_by_fd, pty);
}