version 1.67, 2013/10/10 12:09:34 |
version 1.68, 2013/10/10 12:12:08 |
|
|
setblocking(STDIN_FILENO, 0); |
setblocking(STDIN_FILENO, 0); |
event_set(&client_stdin, STDIN_FILENO, EV_READ|EV_PERSIST, |
event_set(&client_stdin, STDIN_FILENO, EV_READ|EV_PERSIST, |
client_stdin_callback, NULL); |
client_stdin_callback, NULL); |
if (flags & IDENTIFY_TERMIOS) { |
if (flags & CLIENT_CONTROLCONTROL) { |
if (tcgetattr(STDIN_FILENO, &saved_tio) != 0) { |
if (tcgetattr(STDIN_FILENO, &saved_tio) != 0) { |
fprintf(stderr, "tcgetattr failed: %s\n", |
fprintf(stderr, "tcgetattr failed: %s\n", |
strerror(errno)); |
strerror(errno)); |
|
|
ppid = getppid(); |
ppid = getppid(); |
if (client_exittype == MSG_DETACHKILL && ppid > 1) |
if (client_exittype == MSG_DETACHKILL && ppid > 1) |
kill(ppid, SIGHUP); |
kill(ppid, SIGHUP); |
} else if (flags & IDENTIFY_TERMIOS) { |
} else if (flags & CLIENT_CONTROLCONTROL) { |
if (flags & IDENTIFY_CONTROL) { |
if (client_exitreason != CLIENT_EXIT_NONE) |
if (client_exitreason != CLIENT_EXIT_NONE) |
printf("%%exit %s\n", client_exit_message()); |
printf("%%exit %s\n", client_exit_message()); |
else |
else |
printf("%%exit\n"); |
printf("%%exit\n"); |
printf("\033\\"); |
printf("\033\\"); |
|
} |
|
tcsetattr(STDOUT_FILENO, TCSAFLUSH, &saved_tio); |
tcsetattr(STDOUT_FILENO, TCSAFLUSH, &saved_tio); |
} |
} |
setblocking(STDIN_FILENO, 1); |
setblocking(STDIN_FILENO, 1); |