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;