Get rid of hostnamelen variable.

This commit is contained in:
Poul-Henning Kamp 1995-11-14 09:37:22 +00:00
parent a9ad941c7a
commit 9565c0e60d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12287
6 changed files with 14 additions and 26 deletions

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)cd9660_rrip.c 8.2 (Berkeley) 1/23/94
* $Id: cd9660_rrip.c,v 1.6 1995/01/16 17:03:26 joerg Exp $
* $Id: cd9660_rrip.c,v 1.7 1995/05/30 08:05:00 rgrimes Exp $
*/
#include <sys/param.h>
@ -152,7 +152,7 @@ cd9660_rrip_slink(p,ana)
case ISO_SUSP_CFLAG_HOST:
/* Inserting hostname i.e. "kurt.tools.de" */
inbuf = hostname;
wlen = hostnamelen;
wlen = strlen(hostname);
break;
case ISO_SUSP_CFLAG_CONTINUE:
@ -224,7 +224,7 @@ cd9660_rrip_altname(p,ana)
case ISO_SUSP_CFLAG_HOST:
/* Inserting hostname i.e. "kurt.tools.de" */
inbuf = hostname;
wlen = hostnamelen;
wlen = strlen(hostname);
break;
case ISO_SUSP_CFLAG_CONTINUE:

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)cd9660_rrip.c 8.2 (Berkeley) 1/23/94
* $Id: cd9660_rrip.c,v 1.6 1995/01/16 17:03:26 joerg Exp $
* $Id: cd9660_rrip.c,v 1.7 1995/05/30 08:05:00 rgrimes Exp $
*/
#include <sys/param.h>
@ -152,7 +152,7 @@ cd9660_rrip_slink(p,ana)
case ISO_SUSP_CFLAG_HOST:
/* Inserting hostname i.e. "kurt.tools.de" */
inbuf = hostname;
wlen = hostnamelen;
wlen = strlen(hostname);
break;
case ISO_SUSP_CFLAG_CONTINUE:
@ -224,7 +224,7 @@ cd9660_rrip_altname(p,ana)
case ISO_SUSP_CFLAG_HOST:
/* Inserting hostname i.e. "kurt.tools.de" */
inbuf = hostname;
wlen = hostnamelen;
wlen = strlen(hostname);
break;
case ISO_SUSP_CFLAG_CONTINUE:

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94
* $Id: kern_sysctl.c,v 1.45 1995/11/14 09:26:17 phk Exp $
* $Id: kern_sysctl.c,v 1.46 1995/11/14 09:29:15 phk Exp $
*/
/*
@ -149,19 +149,9 @@ SYSCTL_PROC(_kern, KERN_UPDATEINTERVAL, update, CTLTYPE_INT|CTLFLAG_RW,
char hostname[MAXHOSTNAMELEN];
int hostnamelen;
static int
sysctl_kern_hostname SYSCTL_HANDLER_ARGS
{
int error = sysctl_handle_string(oidp,
oidp->oid_arg1, oidp->oid_arg2, req);
if (req->newptr && (error == 0 || error == ENOMEM))
hostnamelen = req->newlen;
return error;
}
SYSCTL_PROC(_kern, KERN_HOSTNAME, hostname, CTLTYPE_STRING|CTLFLAG_RW,
&hostname, sizeof(hostname), sysctl_kern_hostname, "");
SYSCTL_STRING(_kern, KERN_HOSTNAME, hostname, CTLFLAG_RW,
hostname, sizeof(hostname), "");
static int
sysctl_order_cmp(const void *a, const void *b)

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)kernfs_vnops.c 8.6 (Berkeley) 2/10/94
* $Id: kernfs_vnops.c,v 1.11 1995/10/29 15:31:37 phk Exp $
* $Id: kernfs_vnops.c,v 1.12 1995/11/09 08:15:38 bde Exp $
*/
/*
@ -137,7 +137,7 @@ kernfs_xread(kt, buf, len, lenp)
case KTT_HOSTNAME: {
char *cp = hostname;
int xlen = hostnamelen;
int xlen = strlen(hostname);
if (xlen >= (len-2))
return (EINVAL);
@ -185,11 +185,11 @@ kernfs_xwrite(kt, buf, len)
{
switch (kt->kt_tag) {
case KTT_HOSTNAME: {
/* XXX BOGUS !!! no check for the length */
if (buf[len-1] == '\n')
--len;
bcopy(buf, hostname, len);
hostname[len] = '\0';
hostnamelen = len;
return (0);
}

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vfsops.c 8.3 (Berkeley) 1/4/94
* $Id: nfs_vfsops.c,v 1.19 1995/08/24 10:17:39 dfr Exp $
* $Id: nfs_vfsops.c,v 1.20 1995/08/30 17:24:15 dfr Exp $
*/
#include <sys/param.h>
@ -433,7 +433,6 @@ nfs_mountroot()
for (i = 0; i < MAXHOSTNAMELEN; i++)
if (hostname[i] == '\0')
break;
hostnamelen = i;
inittodr(ntohl(nd->root_time));
return (0);
}

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vfsops.c 8.3 (Berkeley) 1/4/94
* $Id: nfs_vfsops.c,v 1.19 1995/08/24 10:17:39 dfr Exp $
* $Id: nfs_vfsops.c,v 1.20 1995/08/30 17:24:15 dfr Exp $
*/
#include <sys/param.h>
@ -433,7 +433,6 @@ nfs_mountroot()
for (i = 0; i < MAXHOSTNAMELEN; i++)
if (hostname[i] == '\0')
break;
hostnamelen = i;
inittodr(ntohl(nd->root_time));
return (0);
}