diff --git a/drivers/serial/ptmx.c b/drivers/serial/ptmx.c index ce33284189..2099328a5a 100644 --- a/drivers/serial/ptmx.c +++ b/drivers/serial/ptmx.c @@ -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 */ diff --git a/drivers/serial/pty.c b/drivers/serial/pty.c index ad6d95ac0c..f55dbddf65 100644 --- a/drivers/serial/pty.c +++ b/drivers/serial/pty.c @@ -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;