#include <string.h>
#include <linux/termios.h>
#include <unistd.h>
+#include "debug.h"
/*
* HACK: declare the ioctl function by hand...
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;
}
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;
}