]> git.itanic.dy.fi Git - log-plotter/blobdiff - baud.c
Add missing initialization
[log-plotter] / baud.c
diff --git a/baud.c b/baud.c
index be2194eecc6218db748191a5d3aafd418ea40438..4fd5168db7e373570e8846055abb2f9c591f2bba 100644 (file)
--- a/baud.c
+++ b/baud.c
@@ -5,6 +5,7 @@
 #include <string.h>
 #include <linux/termios.h>
 #include <unistd.h>
+#include "debug.h"
 
 /*
  * HACK: declare the ioctl function by hand...
@@ -33,12 +34,12 @@ int open_at_baud(const char *device, int *baud)
        fd = open(device, O_RDWR | O_NOCTTY | O_NDELAY);
 
        if (fd == -1) {
-               fprintf(stderr, "error opening %s: %m", device);
+               pr_err("error opening %s: %m\n", device);
                return fd;
        }
 
        if (ioctl(fd, TCGETS2, &tios)) {
-               perror("TCGETS2");
+               pr_err("TCGETS2: %m\n");
                goto err;
        }
 
@@ -48,12 +49,12 @@ int open_at_baud(const char *device, int *baud)
        tios.c_ospeed = *baud;
 
        if (ioctl(fd, TCSETS2, &tios)) {
-               perror("TCSETS2");
+               pr_err("TCSETS2: %m");
                goto err;
        }
 
        if (ioctl(fd, TCGETS2, &tios)) {
-               perror("TCGETS2");
+               pr_err("TCGETS2: %m");
                goto err;
        }