
> To me (but I am no expert)

Nor me, but...

> it looks like it never reaches
> serial_setup(), it fails after serrial_open().

The log shows open, fcntl, tcgettatr, tcgettatr, tcflush,
tcsetattr, tcgettatr.  The NLS stuff is inside perror().

serial_open() does open, fcntl, tcgettatr, tcgettatr.

serial_setup() does tcflush, tcsetattr, tcgettatr, and then fails if
the tcgettatr doesn't match the tcsetattr.  Presumably that's what's
happening.

I would put some debugging printf()s in to see what the settings
returned by the tcgettattr in serial_setup() are.

-- Richard

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

