open serial ports with O_NOCTTY
This commit is contained in:
parent
49c5325cd1
commit
1189b08b54
2
lcd.c
2
lcd.c
@ -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
2
pic.c
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user