|
@@ -211,6 +211,12 @@ static int ptmx_open(struct dfs_fd *fd)
|
|
ret = ld->ops->open(fd);
|
|
ret = ld->ops->open(fd);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ rt_device_t device = (rt_device_t)fd->vnode->data;
|
|
|
|
+ if(fd->vnode->ref_count == 1)
|
|
|
|
+ {
|
|
|
|
+ ret = rt_device_open(device, fd->flags);
|
|
|
|
+ }
|
|
|
|
+
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
#ifdef RT_USING_DEVICE_OPS
|
|
#ifdef RT_USING_DEVICE_OPS
|
|
@@ -286,7 +292,8 @@ static int pts_register(struct tty_struct *ptm_drv, struct tty_struct *pts_drv,
|
|
extern struct termios tty_std_termios;
|
|
extern struct termios tty_std_termios;
|
|
pts_drv->init_termios = tty_std_termios;
|
|
pts_drv->init_termios = tty_std_termios;
|
|
pts_drv->init_termios.c_cflag = B38400 | CS8 | CREAD;
|
|
pts_drv->init_termios.c_cflag = B38400 | CS8 | CREAD;
|
|
- pts_drv->init_termios.c_lflag |= ICANON;
|
|
|
|
|
|
+ pts_drv->init_termios.c_lflag |= ECHO | ICANON;
|
|
|
|
+ pts_drv->init_termios.c_oflag |= ONLCR;
|
|
pts_drv->init_termios.__c_ispeed = 38400;
|
|
pts_drv->init_termios.__c_ispeed = 38400;
|
|
pts_drv->init_termios.__c_ospeed = 38400;
|
|
pts_drv->init_termios.__c_ospeed = 38400;
|
|
|
|
|