Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern In TIOCPTSNAME return the minor number of the devic...



details:   https://anonhg.NetBSD.org/src/rev/c2cd130fff5a
branches:  trunk
changeset: 571189:c2cd130fff5a
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Nov 13 08:46:46 2004 +0000

description:
In TIOCPTSNAME return the minor number of the device in the fd portion of
the structures. It is more useful than -1 and cheap to do. Linux pty emulation
uses it.

diffstat:

 sys/kern/tty_ptm.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 513aa58c89ed -r c2cd130fff5a sys/kern/tty_ptm.c
--- a/sys/kern/tty_ptm.c        Sat Nov 13 08:12:50 2004 +0000
+++ b/sys/kern/tty_ptm.c        Sat Nov 13 08:46:46 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tty_ptm.c,v 1.1 2004/11/10 17:29:54 christos Exp $     */
+/*     $NetBSD: tty_ptm.c,v 1.2 2004/11/13 08:46:46 christos Exp $     */
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tty_ptm.c,v 1.1 2004/11/10 17:29:54 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_ptm.c,v 1.2 2004/11/13 08:46:46 christos Exp $");
 
 #include "opt_ptm.h"
 
@@ -307,8 +307,8 @@
        if (ptm == NULL)
                return EOPNOTSUPP;
 
-       ptmg->cfd = cfd;
-       ptmg->sfd = sfd;
+       ptmg->cfd = cfd == -1 ? minor(dev) : cfd;
+       ptmg->sfd = sfd == -1 ? minor(dev) : sfd;
 
        error = (*ptm->makename)(ptm, ptmg->cn, sizeof(ptmg->cn), dev, 'p');
        if (error)



Home | Main Index | Thread Index | Old Index