Rearrange code
This commit is contained in:
parent
4a80163ecf
commit
a3e4aad42f
22
scsh/tty1.c
22
scsh/tty1.c
|
@ -85,17 +85,12 @@ s48_value scheme_tcgetattr(s48_value sch_fd, s48_value sch_control_chars)
|
|||
int *lflag,
|
||||
int *ispeed, int *ospeed)*/
|
||||
{
|
||||
S48_DECLARE_GC_PROTECT(6);
|
||||
struct termios t;
|
||||
int fd = s48_extract_fixnum(sch_fd);
|
||||
|
||||
if (isatty(fd) == 0) {
|
||||
fprintf(stderr, "%d is not a tty\n", fd);
|
||||
return S48_FALSE;
|
||||
}
|
||||
|
||||
|
||||
int result = tcgetattr(s48_extract_fixnum (sch_fd), &t);
|
||||
int i;
|
||||
int result;
|
||||
|
||||
s48_value sch_iflag = S48_UNSPECIFIC;
|
||||
s48_value sch_oflag = S48_UNSPECIFIC;
|
||||
s48_value sch_cflag = S48_UNSPECIFIC;
|
||||
|
@ -103,7 +98,14 @@ s48_value scheme_tcgetattr(s48_value sch_fd, s48_value sch_control_chars)
|
|||
s48_value sch_ispeed = S48_UNSPECIFIC;
|
||||
s48_value sch_ospeed = S48_UNSPECIFIC;
|
||||
s48_value sch_retval = S48_UNSPECIFIC;
|
||||
S48_DECLARE_GC_PROTECT(6);
|
||||
|
||||
if (isatty(fd) == 0) {
|
||||
fprintf(stderr, "%d is not a tty\n", fd);
|
||||
return S48_FALSE;
|
||||
}
|
||||
|
||||
|
||||
result = tcgetattr(s48_extract_fixnum (sch_fd), &t);
|
||||
|
||||
S48_GC_PROTECT_6(sch_iflag, sch_oflag, sch_cflag, sch_lflag, sch_ispeed,
|
||||
sch_ospeed);
|
||||
|
@ -364,6 +366,7 @@ allocate_pty (void)
|
|||
int master_fd = -1;
|
||||
const char *slave_name = NULL;
|
||||
const char* clone = NULL;
|
||||
int off = 0;
|
||||
|
||||
s48_value scm_slave_name = S48_UNSPECIFIC;
|
||||
|
||||
|
@ -389,7 +392,6 @@ allocate_pty (void)
|
|||
tytso@mit.edu), but apparently it messed up rlogind and telnetd, so he
|
||||
removed the fix in pre2.0.14. - dkindred@cs.cmu.edu
|
||||
*/
|
||||
int off = 0;
|
||||
ioctl (master_fd, TIOCPKT, (char *)&off);
|
||||
#endif /* TIOCPKT */
|
||||
|
||||
|
|
Loading…
Reference in New Issue