open serial ports with O_NOCTTY

This commit is contained in:
Olaf Rempel 2012-11-25 12:59:30 +01:00
parent 49c5325cd1
commit 1189b08b54
2 changed files with 2 additions and 2 deletions

2
lcd.c
View File

@ -130,7 +130,7 @@ void lcd_close(struct lcddev *dev)
static int lcd_open(struct lcddev *dev, const char *device) 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) { if (dev->fd < 0) {
log_print(LOG_ERROR, "%s(): failed to open '%s'", __FUNCTION__, device); log_print(LOG_ERROR, "%s(): failed to open '%s'", __FUNCTION__, device);
return -1; return -1;

2
pic.c
View File

@ -98,7 +98,7 @@ static int pic_close(struct picdev *dev)
static int pic_open(struct picdev *dev, const char *device) 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) { if (dev->fd < 0) {
log_print(LOG_ERROR, "%s(): failed to open '%s'", __FUNCTION__, device); log_print(LOG_ERROR, "%s(): failed to open '%s'", __FUNCTION__, device);
return -1; return -1;