From 1189b08b54cd47039b85a82441ab3b6b7db11604 Mon Sep 17 00:00:00 2001 From: Olaf Rempel Date: Sun, 25 Nov 2012 12:59:30 +0100 Subject: [PATCH] open serial ports with O_NOCTTY --- lcd.c | 2 +- pic.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lcd.c b/lcd.c index 754073c..86d9c43 100644 --- a/lcd.c +++ b/lcd.c @@ -130,7 +130,7 @@ void lcd_close(struct lcddev *dev) static int lcd_open(struct lcddev *dev, const char *device) { - dev->fd = open(device, O_RDWR); + dev->fd = open(device, O_RDWR | O_NOCTTY | O_CLOEXEC); if (dev->fd < 0) { log_print(LOG_ERROR, "%s(): failed to open '%s'", __FUNCTION__, device); return -1; diff --git a/pic.c b/pic.c index 074053d..9fb27aa 100644 --- a/pic.c +++ b/pic.c @@ -98,7 +98,7 @@ static int pic_close(struct picdev *dev) static int pic_open(struct picdev *dev, const char *device) { - dev->fd = open(device, O_RDWR); + dev->fd = open(device, O_RDWR | O_NOCTTY | O_CLOEXEC); if (dev->fd < 0) { log_print(LOG_ERROR, "%s(): failed to open '%s'", __FUNCTION__, device); return -1;