Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/stand Further fallout from making 'path' arg t...



details:   https://anonhg.NetBSD.org/src/rev/3a637c837b2e
branches:  trunk
changeset: 550714:3a637c837b2e
user:      dsl <dsl%NetBSD.org@localhost>
date:      Mon Aug 18 15:47:41 2003 +0000

description:
Further fallout from making 'path' arg to 'ufs_open' 'constchar *'.
There may be fallout in other builds....

diffstat:

 sys/arch/i386/stand/lib/dosfile.c |   6 +++---
 sys/arch/i386/stand/lib/dosfile.h |  12 ++----------
 sys/arch/i386/stand/libsa/nfs.c   |  25 ++++++++++++-------------
 3 files changed, 17 insertions(+), 26 deletions(-)

diffs (138 lines):

diff -r 9bb81b941e4e -r 3a637c837b2e sys/arch/i386/stand/lib/dosfile.c
--- a/sys/arch/i386/stand/lib/dosfile.c Mon Aug 18 15:45:27 2003 +0000
+++ b/sys/arch/i386/stand/lib/dosfile.c Mon Aug 18 15:47:41 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dosfile.c,v 1.7 2003/02/01 14:48:18 dsl Exp $   */
+/*     $NetBSD: dosfile.c,v 1.8 2003/08/18 15:47:41 dsl Exp $   */
 
 /*
  * Copyright (c) 1996
@@ -43,7 +43,7 @@
 #include "diskbuf.h"
 #include "dosfile.h"
 
-extern int dosopen __P((char *));
+extern int dosopen __P((const char *));
 extern void dosclose __P((int));
 extern int dosread __P((int, char *, int));
 extern int dosseek __P((int, int, int));
@@ -80,7 +80,7 @@
 
 int 
 dos_open(path, f)
-       char           *path;
+       const char           *path;
        struct open_file *f;
 {
        struct dosfile *df;
diff -r 9bb81b941e4e -r 3a637c837b2e sys/arch/i386/stand/lib/dosfile.h
--- a/sys/arch/i386/stand/lib/dosfile.h Mon Aug 18 15:45:27 2003 +0000
+++ b/sys/arch/i386/stand/lib/dosfile.h Mon Aug 18 15:47:41 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dosfile.h,v 1.1.1.1 1997/03/14 02:40:32 perry Exp $    */
+/*     $NetBSD: dosfile.h,v 1.2 2003/08/18 15:47:41 dsl Exp $  */
 
 /*
  * Copyright (c) 1996
@@ -32,12 +32,4 @@
  *
  */
 
-
-int dos_open __P((char *path, struct open_file *f));
-int dos_read __P((struct open_file *f,void *addr,
-             size_t size, size_t *resid));
-int dos_close __P((struct open_file *f));
-int dos_write __P((struct open_file *f,void *addr,
-             size_t size, size_t *resid));
-int dos_stat __P((struct open_file *f, struct stat *sb));
-off_t dos_seek __P((struct open_file *f, off_t offset, int where));
+FS_DEF(dos);
diff -r 9bb81b941e4e -r 3a637c837b2e sys/arch/i386/stand/libsa/nfs.c
--- a/sys/arch/i386/stand/libsa/nfs.c   Mon Aug 18 15:45:27 2003 +0000
+++ b/sys/arch/i386/stand/libsa/nfs.c   Mon Aug 18 15:47:41 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs.c,v 1.6 2003/03/19 17:27:43 drochner Exp $ */
+/*     $NetBSD: nfs.c,v 1.7 2003/08/18 15:47:43 dsl Exp $      */
 
 /*-
  *  Copyright (c) 1993 John Brezak
@@ -101,7 +101,8 @@
 };
 
 int    nfs_getrootfh __P((struct iodesc *, char *, u_char *));
-int    nfs_lookupfh __P((struct nfs_iodesc *, char *, struct nfs_iodesc *));
+int    nfs_lookupfh __P((struct nfs_iodesc *, const char *, int,
+           struct nfs_iodesc *));
 #ifndef NFS_NOSYMLINK
 int    nfs_readlink __P((struct nfs_iodesc *, char *));
 #endif
@@ -171,12 +172,13 @@
  * Return zero or error number.
  */
 int
-nfs_lookupfh(d, name, newfd)
+nfs_lookupfh(d, name, len, newfd)
        struct nfs_iodesc *d;
-       char *name;
+       const char *name;
+       int len;
        struct nfs_iodesc *newfd;
 {
-       int len, rlen;
+       int rlen;
        struct args {
                u_char  fh[NFS_FHSIZE];
                n_long  len;
@@ -207,7 +209,6 @@
 
        memset(args, 0, sizeof(*args));
        memcpy(args->fh, d->fh, sizeof(args->fh));
-       len = strlen(name);
        if (len > sizeof(args->name))
                len = sizeof(args->name);
        memcpy(args->name, name, len);
@@ -347,17 +348,17 @@
  */
 int
 nfs_open(path, f)
-       char *path;
+       const char *path;
        struct open_file *f;
 {
        static struct nfs_iodesc nfs_root_node;
        struct iodesc *desc;
        struct nfs_iodesc *currfd;
-       char *cp;
+       const char *cp;
 #ifndef NFS_NOSYMLINK
        struct nfs_iodesc *newfd;
        struct nfsv2_fattrs *fa;
-       char *ncp;
+       const char *ncp;
        int c;
        char namebuf[NFS_MAXPATHLEN + 1];
        char linkbuf[NFS_MAXPATHLEN + 1];
@@ -431,12 +432,10 @@
                                }
                                cp++;
                        }
-                       *cp = '\0';
                }
                
                /* lookup a file handle */
-               error = nfs_lookupfh(currfd, ncp, newfd);
-               *cp = c;
+               error = nfs_lookupfh(currfd, ncp, cp - ncp, newfd);
                if (error)
                        goto out;
                
@@ -505,7 +504,7 @@
 
        /* XXX: Check for empty path here? */
 
-        error = nfs_lookupfh(&nfs_root_node, cp, currfd);
+        error = nfs_lookupfh(&nfs_root_node, cp, strlen(cp), currfd);
 #endif
        if (!error) {
                f->f_fsdata = (void *)currfd;



Home | Main Index | Thread Index | Old Index