]> the.earth.li Git - sersniff.git/commitdiff
Use cfsetspeed to set port speed rather than c_cflags.
authorPeter Baker <peter.baker@eee.strath.ac.uk>
Wed, 29 Jun 2011 04:12:06 +0000 (21:12 -0700)
committerJonathan McDowell <noodles@earth.li>
Wed, 29 Jun 2011 04:12:06 +0000 (21:12 -0700)
sersniff.c

index 64e05767fbfa0a3813bc8e68d9015e230e983ef9..45572dc15f91b61c70a490e2aa87aa95fdd8a0c4 100644 (file)
@@ -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);