diff options
Diffstat (limited to 'ptyim.c')
-rw-r--r-- | ptyim.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -10,6 +10,7 @@ #include <termios.h> #include <string.h> #include <signal.h> +#include <sys/prctl.h> #include "im.h" #define WRITE_BUFFER_LEN 128 //determines if the master process is running @@ -50,8 +51,6 @@ int make_pty() { fprintf(stderr, "errno: %d, failed to create pty master", errno); return errno; } - //make the master pty nonblocking - fcntl(pty_master, F_SETFL,O_NONBLOCK); //unlock the slave pty if ( unlockpt(pty_master) <0) { fprintf(stderr, "errno: %d, failed to unlock pty slave", errno); @@ -72,7 +71,7 @@ int make_pty() { tcsetattr(pty_slave,TCSANOW,&stdin_termio_bk); return 0; } -//makes stdin raw and unblocking, previous state stored in global var +//makes stdin raw previous state stored in global var //stdin_termio_bk void condition_stdin() { struct termios stdin_termio; @@ -82,8 +81,6 @@ void condition_stdin() { //make it raw cfmakeraw(&stdin_termio); tcsetattr(STDIN_FILENO,TCSANOW,&stdin_termio); - //make it nonblocking - fcntl(STDIN_FILENO, F_SETFL,O_NONBLOCK); } void restore_stdin() { tcsetattr(STDIN_FILENO,TCSANOW,&stdin_termio_bk); |