Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/ptyfs make the order of the arguments in the PTYFS_FI...



details:   https://anonhg.NetBSD.org/src/rev/df3aa5e0163c
branches:  trunk
changeset: 946427:df3aa5e0163c
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Nov 27 14:43:57 2020 +0000

description:
make the order of the arguments in the PTYFS_FILENO macro consistent with
the order in the function calls. One of them was incorrect. Noticed by martin@

diffstat:

 sys/fs/ptyfs/ptyfs.h       |  4 ++--
 sys/fs/ptyfs/ptyfs_subr.c  |  6 +++---
 sys/fs/ptyfs/ptyfs_vnops.c |  8 ++++----
 3 files changed, 9 insertions(+), 9 deletions(-)

diffs (81 lines):

diff -r 28061275342f -r df3aa5e0163c sys/fs/ptyfs/ptyfs.h
--- a/sys/fs/ptyfs/ptyfs.h      Fri Nov 27 08:39:07 2020 +0000
+++ b/sys/fs/ptyfs/ptyfs.h      Fri Nov 27 14:43:57 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ptyfs.h,v 1.15 2020/01/17 20:08:08 ad Exp $    */
+/*     $NetBSD: ptyfs.h,v 1.16 2020/11/27 14:43:57 christos Exp $      */
 
 /*
  * Copyright (c) 1993
@@ -140,7 +140,7 @@
 
 #define UIO_MX 32
 
-#define PTYFS_FILENO(pty, type) \
+#define PTYFS_FILENO(type, pty) \
     ((type == PTYFSroot) ? 2 : \
      ((((pty) + 1) * 2 + (((type) == PTYFSpts) ? 1 : 2))))
 
diff -r 28061275342f -r df3aa5e0163c sys/fs/ptyfs/ptyfs_subr.c
--- a/sys/fs/ptyfs/ptyfs_subr.c Fri Nov 27 08:39:07 2020 +0000
+++ b/sys/fs/ptyfs/ptyfs_subr.c Fri Nov 27 14:43:57 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ptyfs_subr.c,v 1.33 2014/10/15 15:00:03 christos Exp $ */
+/*     $NetBSD: ptyfs_subr.c,v 1.34 2020/11/27 14:43:57 christos Exp $ */
 
 /*
  * Copyright (c) 1993
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ptyfs_subr.c,v 1.33 2014/10/15 15:00:03 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ptyfs_subr.c,v 1.34 2020/11/27 14:43:57 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -162,7 +162,7 @@
        pp = malloc(sizeof(struct ptyfsnode), M_TEMP, M_WAITOK);
        pp->ptyfs_pty = pty;
        pp->ptyfs_type = type;
-       pp->ptyfs_fileno = PTYFS_FILENO(pty, type);
+       pp->ptyfs_fileno = PTYFS_FILENO(type, pty);
        if (pp->ptyfs_type == PTYFSroot)
                pp->ptyfs_mode = S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|
                    S_IROTH|S_IXOTH;
diff -r 28061275342f -r df3aa5e0163c sys/fs/ptyfs/ptyfs_vnops.c
--- a/sys/fs/ptyfs/ptyfs_vnops.c        Fri Nov 27 08:39:07 2020 +0000
+++ b/sys/fs/ptyfs/ptyfs_vnops.c        Fri Nov 27 14:43:57 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ptyfs_vnops.c,v 1.61 2020/11/24 16:38:31 christos Exp $        */
+/*     $NetBSD: ptyfs_vnops.c,v 1.62 2020/11/27 14:43:57 christos Exp $        */
 
 /*
  * Copyright (c) 1993, 1995
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ptyfs_vnops.c,v 1.61 2020/11/24 16:38:31 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ptyfs_vnops.c,v 1.62 2020/11/27 14:43:57 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -715,7 +715,7 @@
 
        for (; i < 2; i++) {
                /* `.' and/or `..' */
-               dp->d_fileno = PTYFS_FILENO(0, PTYFSroot);
+               dp->d_fileno = PTYFS_FILENO(PTYFSroot, 0);
                dp->d_namlen = i + 1;
                (void)memcpy(dp->d_name, "..", dp->d_namlen);
                dp->d_name[i + 1] = '\0';
@@ -731,7 +731,7 @@
                n = ptyfs_next_active(vp->v_mount, i - 2);
                if (n < 0)
                        break;
-               dp->d_fileno = PTYFS_FILENO(n, PTYFSpts);
+               dp->d_fileno = PTYFS_FILENO(PTYFSpts, n);
                dp->d_namlen = snprintf(dp->d_name, sizeof(dp->d_name),
                    "%lld", (long long)(n));
                dp->d_type = DT_CHR;



Home | Main Index | Thread Index | Old Index