X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fserial.c;h=2b77db655b2cec0d88772949c9ba9d72b80951cf;hp=5057fd3ad8342f871f3820a425294a52a93722b8;hb=a9e50e9e30ecde17e167e271060c8183bfcbf407;hpb=eec0cd9ca51c5c132ed09fc4699c02f3bd12d748 diff --git a/src/serial.c b/src/serial.c index 5057fd3a..2b77db65 100644 --- a/src/serial.c +++ b/src/serial.c @@ -52,9 +52,8 @@ static int serial_read(void) { /* there are a variety of names for the serial device */ if ((fh = fopen("/proc/tty/driver/serial", "r")) == NULL && (fh = fopen("/proc/tty/driver/ttyS", "r")) == NULL) { - char errbuf[1024]; - WARNING("serial: fopen: %s", sstrerror(errno, errbuf, sizeof(errbuf))); - return (-1); + WARNING("serial: fopen: %s", STRERRNO); + return -1; } while (fgets(buffer, sizeof(buffer), fh) != NULL) { @@ -100,7 +99,7 @@ static int serial_read(void) { } fclose(fh); - return (0); + return 0; } /* int serial_read */ void module_register(void) {