From: Peter Baker Date: Wed, 29 Jun 2011 04:12:06 +0000 (-0700) Subject: Use cfsetspeed to set port speed rather than c_cflags. X-Git-Tag: sersniff-0.0.5~3 X-Git-Url: https://the.earth.li/gitweb/?a=commitdiff_plain;h=c69cff83dba527eb3fd6d56b87d876334ae93ad8;p=sersniff.git Use cfsetspeed to set port speed rather than c_cflags. --- 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);