aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2000-09-16 13:43:00 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2000-09-16 13:43:00 +0000
commitfc87418be0c33ac352343212ca17832b2bbf8708 (patch)
tree367864628415ce14de481b4a3fbd5677a5e77a8a /sbin
parentc80d29139c6272f1f3a95ad25c2ed90dfd92d919 (diff)
downloadsrc-fc87418be0c33ac352343212ca17832b2bbf8708.tar.gz
src-fc87418be0c33ac352343212ca17832b2bbf8708.zip
Turn dkcksum() into an __inline function.
Change its type to u_int_16_t.
Notes
Notes: svn path=/head/; revision=65921
Diffstat (limited to 'sbin')
-rw-r--r--sbin/bsdlabel/Makefile2
-rw-r--r--sbin/bsdlabel/bsdlabel.c1
-rw-r--r--sbin/bsdlabel/dkcksum.c57
-rw-r--r--sbin/disklabel/Makefile2
-rw-r--r--sbin/disklabel/disklabel.c1
-rw-r--r--sbin/disklabel/dkcksum.c57
-rw-r--r--sbin/newfs/Makefile5
7 files changed, 5 insertions, 120 deletions
diff --git a/sbin/bsdlabel/Makefile b/sbin/bsdlabel/Makefile
index 4090fc418d95..5513ad30437a 100644
--- a/sbin/bsdlabel/Makefile
+++ b/sbin/bsdlabel/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
PROG= disklabel
-SRCS= disklabel.c dkcksum.c
+SRCS= disklabel.c
MAN8= disklabel.8
MAN5= disklabel.5
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c
index 1f396a18f4be..a3fc78862e26 100644
--- a/sbin/bsdlabel/bsdlabel.c
+++ b/sbin/bsdlabel/bsdlabel.c
@@ -105,7 +105,6 @@ int checklabel __P((struct disklabel *));
void setbootflag __P((struct disklabel *));
void Warning (char *, ...);
void usage __P((void));
-extern u_short dkcksum __P((struct disklabel *));
struct disklabel * getvirginlabel __P((void));
#define DEFEDITOR _PATH_VI
diff --git a/sbin/bsdlabel/dkcksum.c b/sbin/bsdlabel/dkcksum.c
deleted file mode 100644
index 3a58aa23044b..000000000000
--- a/sbin/bsdlabel/dkcksum.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)dkcksum.c 8.1 (Berkeley) 6/5/93";
-#endif
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
-
-#include <sys/types.h>
-#include <sys/disklabel.h>
-
-u_short
-dkcksum(lp)
- register struct disklabel *lp;
-{
- register u_short *start, *end;
- register u_short sum = 0;
-
- start = (u_short *)lp;
- end = (u_short *)&lp->d_partitions[lp->d_npartitions];
- while (start < end)
- sum ^= *start++;
- return (sum);
-}
diff --git a/sbin/disklabel/Makefile b/sbin/disklabel/Makefile
index 4090fc418d95..5513ad30437a 100644
--- a/sbin/disklabel/Makefile
+++ b/sbin/disklabel/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
PROG= disklabel
-SRCS= disklabel.c dkcksum.c
+SRCS= disklabel.c
MAN8= disklabel.8
MAN5= disklabel.5
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index 1f396a18f4be..a3fc78862e26 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -105,7 +105,6 @@ int checklabel __P((struct disklabel *));
void setbootflag __P((struct disklabel *));
void Warning (char *, ...);
void usage __P((void));
-extern u_short dkcksum __P((struct disklabel *));
struct disklabel * getvirginlabel __P((void));
#define DEFEDITOR _PATH_VI
diff --git a/sbin/disklabel/dkcksum.c b/sbin/disklabel/dkcksum.c
deleted file mode 100644
index 3a58aa23044b..000000000000
--- a/sbin/disklabel/dkcksum.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)dkcksum.c 8.1 (Berkeley) 6/5/93";
-#endif
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
-
-#include <sys/types.h>
-#include <sys/disklabel.h>
-
-u_short
-dkcksum(lp)
- register struct disklabel *lp;
-{
- register u_short *start, *end;
- register u_short sum = 0;
-
- start = (u_short *)lp;
- end = (u_short *)&lp->d_partitions[lp->d_npartitions];
- while (start < end)
- sum ^= *start++;
- return (sum);
-}
diff --git a/sbin/newfs/Makefile b/sbin/newfs/Makefile
index 7ad8c5a0b1ca..7dc817c96636 100644
--- a/sbin/newfs/Makefile
+++ b/sbin/newfs/Makefile
@@ -1,12 +1,13 @@
# @(#)Makefile 8.2 (Berkeley) 3/27/94
+# $FreeBSD$
PROG= newfs
-SRCS= dkcksum.c getmntopts.c newfs.c mkfs.c
+SRCS= getmntopts.c newfs.c mkfs.c
MAN8= newfs.8
MOUNT= ${.CURDIR}/../mount
CFLAGS+=-DMFS -DFSIRAND -I${MOUNT}
-.PATH: ${MOUNT} ${.CURDIR}/../disklabel
+.PATH: ${MOUNT}
LINKS= ${BINDIR}/newfs ${BINDIR}/mount_mfs
MLINKS= newfs.8 mount_mfs.8 newfs.8 mfs.8 newfs.8 tmpfs.8