1
0
mirror of https://github.com/UzixLS/picocom.git synced 2025-07-19 07:21:18 +03:00

USE_CUSTOM_BAUD support for linux/powerpc[64le].

The powerpc[64le] arch uses different ioctls for custom baud setting: It
uses the old TCSETS*, TCGETS ioctls, not the new TCSETS*2, TCGETS2 ones.

Cross-compiles cleanly, not tested (no h/w currently available).
This commit is contained in:
Nick Patavalis
2015-08-27 23:22:56 +03:00
parent bc9ab1fdf5
commit a65e9e1e3a
2 changed files with 41 additions and 6 deletions

View File

@ -56,13 +56,13 @@ tc2setattr(int fd, int optional_actions, const struct termios *tios)
switch (optional_actions) {
case TCSANOW:
cmd = TCSETS2;
cmd = IOCTL_SETS;
break;
case TCSADRAIN:
cmd = TCSETSW2;
cmd = IOCTL_SETSW;
break;
case TCSAFLUSH:
cmd = TCSETSF2;
cmd = IOCTL_SETSF;
break;
default:
errno = EINVAL;
@ -88,7 +88,7 @@ tc2getattr(int fd, struct termios *tios)
size_t i;
int r;
r = ioctl(fd, TCGETS2, &t2);
r = ioctl(fd, IOCTL_GETS, &t2);
if (r < 0) return r;
tios->c_iflag = t2.c_iflag;