aboutsummaryrefslogtreecommitdiff
path: root/lib/serial/builtin/unix_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/serial/builtin/unix_dev.c')
-rw-r--r--lib/serial/builtin/unix_dev.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/serial/builtin/unix_dev.c b/lib/serial/builtin/unix_dev.c
index 037f425..e165e22 100644
--- a/lib/serial/builtin/unix_dev.c
+++ b/lib/serial/builtin/unix_dev.c
@@ -1,6 +1,7 @@
#include "../../internals.h"
#ifndef LIBTIO_DISABLED_UNIX
+# include <errno.h>
# include <string.h>
# include <dirent.h>
# include <unistd.h>
@@ -81,7 +82,7 @@ TIO_HOOK(int) next_serial_port(cookie_t *cookie, char const **ptr)
/* Get the next entry. */
if (!(dr = readdir(cookie->dp)))
- return (casio_error_iter);
+ return (tio_error_iter);
/* Check the name. */
@@ -103,7 +104,7 @@ TIO_HOOK(int) next_serial_port(cookie_t *cookie, char const **ptr)
TIO_HOOK(void) end_iter(cookie_t *cookie)
{
- closedir(d);
+ closedir(cookie->dp);
tio_free(cookie);
}
@@ -130,7 +131,7 @@ TIO_EXTERN(int) tio_list_unix_serial_ports_using_cu_devices(tio_iter_t **iterp)
/* Create the cookie. */
if (!(cookie = tio_alloc(1, sizeof(cookie) + path_max)))
- return (casio_error_alloc);
+ return (tio_error_alloc);
cookie->path = (char *)(void *)&cookie[1];