From 6bce784d06c24e461a05ceeef7b20d434cb8c60d Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Tue, 3 Sep 1996 23:17:15 +0000 Subject: [PATCH] Changed type of ni_dirp in `struct namei' from caddr_t to `const char *' so that the compiler can see that it is OK to use const strings in NDINIT(). Some emulators want to use paths of the form "/compat/foo". Removed the casts that hid the non-problem. Didn't fix the missing consts in syscalls.master that hid the non-problem. --- sys/compat/linux/linux_util.c | 7 +++---- sys/i386/ibcs2/ibcs2_util.c | 5 ++--- sys/i386/linux/linux_util.c | 7 +++---- sys/sys/namei.h | 4 ++-- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/sys/compat/linux/linux_util.c b/sys/compat/linux/linux_util.c index bc4efddd005..7025e5071f5 100644 --- a/sys/compat/linux/linux_util.c +++ b/sys/compat/linux/linux_util.c @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * from: svr4_util.c,v 1.5 1995/01/22 23:44:50 christos Exp - * $Id: linux_util.c,v 1.1 1996/03/02 19:38:02 peter Exp $ + * $Id: linux_util.c,v 1.2 1996/08/05 20:52:30 nate Exp $ */ #include @@ -134,9 +134,8 @@ linux_emul_find(p, sgp, prefix, path, pbuf, cflag) * root directory and never finding it, because "/" resolves * to the emulation root directory. This is expensive :-( */ - /* XXX: prototype should have const here for NDINIT */ - NDINIT(&ndroot, LOOKUP, FOLLOW, UIO_SYSSPACE, - (char *) linux_emul_path, p); + NDINIT(&ndroot, LOOKUP, FOLLOW, UIO_SYSSPACE, linux_emul_path, + p); if ((error = namei(&ndroot)) != 0) { /* Cannot happen! */ diff --git a/sys/i386/ibcs2/ibcs2_util.c b/sys/i386/ibcs2/ibcs2_util.c index 3f7cb2a86eb..425f5a81743 100644 --- a/sys/i386/ibcs2/ibcs2_util.c +++ b/sys/i386/ibcs2/ibcs2_util.c @@ -133,9 +133,8 @@ ibcs2_emul_find(p, sgp, prefix, path, pbuf, cflag) * root directory and never finding it, because "/" resolves * to the emulation root directory. This is expensive :-( */ - /* XXX: prototype should have const here for NDINIT */ - NDINIT(&ndroot, LOOKUP, FOLLOW, UIO_SYSSPACE, - (char *) ibcs2_emul_path, p); + NDINIT(&ndroot, LOOKUP, FOLLOW, UIO_SYSSPACE, ibcs2_emul_path, + p); if ((error = namei(&ndroot)) != 0) { /* Cannot happen! */ diff --git a/sys/i386/linux/linux_util.c b/sys/i386/linux/linux_util.c index bc4efddd005..7025e5071f5 100644 --- a/sys/i386/linux/linux_util.c +++ b/sys/i386/linux/linux_util.c @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * from: svr4_util.c,v 1.5 1995/01/22 23:44:50 christos Exp - * $Id: linux_util.c,v 1.1 1996/03/02 19:38:02 peter Exp $ + * $Id: linux_util.c,v 1.2 1996/08/05 20:52:30 nate Exp $ */ #include @@ -134,9 +134,8 @@ linux_emul_find(p, sgp, prefix, path, pbuf, cflag) * root directory and never finding it, because "/" resolves * to the emulation root directory. This is expensive :-( */ - /* XXX: prototype should have const here for NDINIT */ - NDINIT(&ndroot, LOOKUP, FOLLOW, UIO_SYSSPACE, - (char *) linux_emul_path, p); + NDINIT(&ndroot, LOOKUP, FOLLOW, UIO_SYSSPACE, linux_emul_path, + p); if ((error = namei(&ndroot)) != 0) { /* Cannot happen! */ diff --git a/sys/sys/namei.h b/sys/sys/namei.h index 9614909f411..fed21012004 100644 --- a/sys/sys/namei.h +++ b/sys/sys/namei.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)namei.h 8.5 (Berkeley) 1/9/95 - * $Id: namei.h,v 1.10 1996/02/26 18:40:44 hsu Exp $ + * $Id: namei.h,v 1.10 1996/03/11 02:25:04 hsu Exp $ */ #ifndef _SYS_NAMEI_H_ @@ -46,7 +46,7 @@ struct nameidata { /* * Arguments to namei/lookup. */ - caddr_t ni_dirp; /* pathname pointer */ + const char *ni_dirp; /* pathname pointer */ enum uio_seg ni_segflg; /* location of pathname */ /* u_long ni_nameiop; namei operation */ /* u_long ni_flags; flags to namei */