PTY: Fix a few errors from early testing
This commit is contained in:
parent
e7f0a56498
commit
4b5149b244
|
@ -226,7 +226,13 @@ static int ptmx_open(FAR struct file *filep)
|
|||
goto errout_with_sem;
|
||||
}
|
||||
|
||||
/* Create the master slave pair */
|
||||
/* Create the master slave pair. This should create:
|
||||
*
|
||||
* Slave device: /dev/pts/N
|
||||
* Master device: /dev/ptyN
|
||||
*
|
||||
* Where N=minor
|
||||
*/
|
||||
|
||||
ret = pty_register(minor);
|
||||
if (ret < 0)
|
||||
|
@ -234,9 +240,9 @@ static int ptmx_open(FAR struct file *filep)
|
|||
goto errout_with_minor;
|
||||
}
|
||||
|
||||
/* Open the master side */
|
||||
/* Open the master device: /dev/ptyN, where N=minor */
|
||||
|
||||
snprintf(devname, 16, "/dev/ttyp%d", minor);
|
||||
snprintf(devname, 16, "/dev/pty%d", minor);
|
||||
fd = open(devname, O_RDWR);
|
||||
DEBUGASSERT(fd >= 0); /* open() should never fail */
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ struct pty_devpair_s
|
|||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static const struct file_operations pty_fops =
|
||||
static const struct file_operations g_pty_fops =
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
pty_open, /* open */
|
||||
|
@ -691,7 +691,7 @@ int pty_register(int minor)
|
|||
snprintf(devname, 16, "/dev/pts/%d", minor);
|
||||
#endif
|
||||
|
||||
ret = register_driver(devname, &pty_fops, 0666, &devpair->pp_slave);
|
||||
ret = register_driver(devname, &g_pty_fops, 0666, &devpair->pp_slave);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto errout_with_pipeb;
|
||||
|
@ -707,7 +707,7 @@ int pty_register(int minor)
|
|||
|
||||
snprintf(devname, 16, "/dev/pty%d", minor);
|
||||
|
||||
ret = register_driver(devname, &pty_fops, 0666, &devpair->pp_master);
|
||||
ret = register_driver(devname, &g_pty_fops, 0666, &devpair->pp_master);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto errout_with_slave;
|
||||
|
|
Loading…
Reference in New Issue