From c69cff83dba527eb3fd6d56b87d876334ae93ad8 Mon Sep 17 00:00:00 2001 From: Peter Baker Date: Tue, 28 Jun 2011 21:12:06 -0700 Subject: [PATCH] Use cfsetspeed to set port speed rather than c_cflags. --- sersniff.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sersniff.c b/sersniff.c index 64e0576..45572dc 100644 --- a/sersniff.c +++ b/sersniff.c @@ -59,8 +59,9 @@ int openport(const char *device, speed_t baud, int setup) if (setup) { bzero(&serparams, sizeof(serparams)); - - serparams.c_cflag=baud | CLOCAL | CS8 | CREAD; + + cfsetspeed(&serparams, baud); + serparams.c_cflag |= CLOCAL | CS8 | CREAD; if (tcflush(filedes, TCIFLUSH)) { fprintf(stderr,"%s: ",device); -- 2.39.5