aboutsummaryrefslogtreecommitdiff
path: root/libwmc/src/com.c
diff options
context:
space:
mode:
Diffstat (limited to 'libwmc/src/com.c')
-rw-r--r--libwmc/src/com.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/libwmc/src/com.c b/libwmc/src/com.c
index 751dd4a7..2f4d3b3c 100644
--- a/libwmc/src/com.c
+++ b/libwmc/src/com.c
@@ -23,16 +23,16 @@
#include "com.h"
#include "errors.h"
-wbool
-wmc_port_setup (int fd, WmcError **error)
+int
+wmc_port_setup (int fd)
{
struct termios stbuf;
errno = 0;
memset (&stbuf, 0, sizeof (stbuf));
if (tcgetattr (fd, &stbuf) != 0) {
- wmc_error_set (error, WMC_SERIAL_ERROR, WMC_SERIAL_ERROR_CONFIG_FAILED,
- "tcgetattr() error: %d", errno);
+ wmc_err (0, "tcgetattr() error: %d", errno);
+ return -WMC_ERROR_SERIAL_CONFIG_FAILED;
}
stbuf.c_cflag &= ~(CBAUD | CSIZE | CSTOPB | CLOCAL | PARENB);
@@ -47,11 +47,10 @@ wmc_port_setup (int fd, WmcError **error)
errno = 0;
if (tcsetattr (fd, TCSANOW, &stbuf) < 0) {
- wmc_error_set (error, WMC_SERIAL_ERROR, WMC_SERIAL_ERROR_CONFIG_FAILED,
- "tcsetattr() error: %d", errno);
- return FALSE;
+ wmc_err (0, "tcgetattr() error: %d", errno);
+ return -WMC_ERROR_SERIAL_CONFIG_FAILED;
}
- return TRUE;
+ return 0;
}