View | Details | Raw Unified | Return to bug 14977
Collapse All | Expand All

(-)./conserver/consent.c (-7 / +13 lines)
Lines 77-84 Link Here
77
#endif
77
#endif
78
78
79
79
80
BAUD baud [] = {
80
BAUD baud [] = {
81
#if defined(B115200)
82
	{ "115200", B115200 },
83
#endif
84
#if defined(B57600)
85
	{ "57600", B57600 },
86
#endif
81
#if defined(B38400)
87
#if defined(B38400)
82
	{ "38400", B38400 },
88
	{ "38400", B38400 },
83
#endif
89
#endif
84
#if defined(B19200)
90
#if defined(B19200)
Lines 196-212 Link Here
196
	 * Turn on:	ixoff
202
	 * Turn on:	ixoff
197
	 */
203
	 */
198
	termp.c_iflag = IXON|IXOFF|BRKINT;
204
	termp.c_iflag = IXON|IXOFF|BRKINT;
199
	termp.c_oflag = 0;
205
	termp.c_oflag = 0;
200
	termp.c_cflag = CREAD;
206
	termp.c_cflag = CREAD | (termp.c_cflag & (CLOCAL|CRTSCTS));
201
	termp.c_cflag |= pCE->pparity->iset;
207
	termp.c_cflag |= pCE->pparity->iset;
202
	termp.c_lflag = 0;
208
	termp.c_lflag = 0;
203
	/*
209
	/*
204
	 * Set the VMIN == 128
210
	 * Set the VMIN == 128
205
	 * Set the VTIME == 1 (0.1 sec)
211
	 * Set the VTIME == 1 (0.1 sec)
206
	 * Don't bother with the control characters as they are not used
212
	 * Don't bother with the control characters as they are not used
207
	 */
213
	 */
208
	termp.c_cc[VMIN] = 128;
214
	termp.c_cc[VMIN] = 1;
209
	termp.c_cc[VTIME] = 1;
215
	termp.c_cc[VTIME] = 1;
210
216
211
	if (-1 == cfsetospeed(&termp,pCE->pbaud->irate)) {
217
	if (-1 == cfsetospeed(&termp,pCE->pbaud->irate)) {
212
		fprintf(stderr, "%s: cfsetospeed: %s(%d): %s\n", progname, pCE->dfile, pCE->fdtty, strerror(errno));
218
		fprintf(stderr, "%s: cfsetospeed: %s(%d): %s\n", progname, pCE->dfile, pCE->fdtty, strerror(errno));
Lines 423-439 Link Here
423
	(void)ioctl(0, I_PUSH, "stty_ld");
429
	(void)ioctl(0, I_PUSH, "stty_ld");
424
#endif
430
#endif
425
431
426
#if USE_TERMIOS
432
#if USE_TERMIOS
427
	if (0 != ioctl(0, TCGETS, & n_tio)) {
433
	if (0 != tcgetattr(0, & n_tio)) {
428
		fprintf(stderr, "%s: iotcl: getsw: %s\n", progname, strerror(errno));
434
		fprintf(stderr, "%s: iotcl: getsw: %s\n", progname, strerror(errno));
429
		exit(1);
435
		exit(1);
430
	}
436
	}
431
	n_tio.c_iflag &= ~(IGNCR|IUCLC);
437
438
	n_tio.c_iflag &= ~(IGNCR);
432
	n_tio.c_iflag |= ICRNL|IXON|IXANY;
439
	n_tio.c_iflag |= ICRNL|IXON|IXANY;
433
	n_tio.c_oflag &= ~(OLCUC|ONOCR|ONLRET|OFILL|NLDLY|CRDLY|TABDLY|BSDLY);
434
	n_tio.c_oflag |= OPOST|ONLCR;
440
	n_tio.c_oflag |= OPOST|ONLCR;
435
	n_tio.c_lflag &= ~(XCASE|NOFLSH|ECHOK|ECHONL);
441
	n_tio.c_lflag &= ~(NOFLSH|ECHOK|ECHONL);
436
	n_tio.c_lflag |= ISIG|ICANON|ECHO;
442
	n_tio.c_lflag |= ISIG|ICANON|ECHO;
437
	n_tio.c_cc[VEOF] = '\004';
443
	n_tio.c_cc[VEOF] = '\004';
438
	n_tio.c_cc[VEOL] = '\000';
444
	n_tio.c_cc[VEOL] = '\000';
439
	n_tio.c_cc[VERASE] = '\010';
445
	n_tio.c_cc[VERASE] = '\010';
Lines 443-451 Link Here
443
	n_tio.c_cc[VQUIT] = '\034';
449
	n_tio.c_cc[VQUIT] = '\034';
444
	n_tio.c_cc[VSTART] = '\021';
450
	n_tio.c_cc[VSTART] = '\021';
445
	n_tio.c_cc[VSTOP] = '\023';
451
	n_tio.c_cc[VSTOP] = '\023';
446
	n_tio.c_cc[VSUSP] = '\032';
452
	n_tio.c_cc[VSUSP] = '\032';
447
	if (0 != ioctl(0, TCSETS, & n_tio)) {
453
	if (0 != tcsetattr(0, TCSANOW, & n_tio)) {
448
		fprintf(stderr, "%s: getarrt: %s\n", progname, strerror(errno));
454
		fprintf(stderr, "%s: getarrt: %s\n", progname, strerror(errno));
449
		exit(1);
455
		exit(1);
450
	}
456
	}

Return to bug 14977