summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/serial.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/serial.c b/src/serial.c
index 1cbd3c06..6316e459 100644
--- a/src/serial.c
+++ b/src/serial.c
@@ -73,14 +73,16 @@ osmo_serial_init(const char *dev, speed_t baudrate)
flags = fcntl(fd, F_GETFL, 0);
if (flags < 0) {
dbg_perror("fcntl get flags");
- return -1;
+ rc = -errno;
+ goto error;
}
flags &= ~O_NONBLOCK;
rc = fcntl(fd, F_SETFL, flags);
if (rc != 0) {
dbg_perror("fcntl set flags");
- return -1;
+ rc = -errno;
+ goto error;
}
/* Configure serial interface */