summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2000-04-14 06:15:01 +0000
committerimp <imp@FreeBSD.org>2000-04-14 06:15:01 +0000
commit7fec3d2787608459e561d33aa2c5f4370c7eb11f (patch)
treedcaa461be797396514a3cad83c83a102b6255162 /sbin
parent212803777e16b9fe9d5c92e839ece868ac93b66b (diff)
downloadFreeBSD-src-7fec3d2787608459e561d33aa2c5f4370c7eb11f.zip
FreeBSD-src-7fec3d2787608459e561d33aa2c5f4370c7eb11f.tar.gz
Add include of errno.h where needed, remove extern int errno where not.
These commits were inspired by a similar commit to netbsd.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/bsdlabel/bsdlabel.c4
-rw-r--r--sbin/disklabel/disklabel.c4
-rw-r--r--sbin/dump/dumprmt.c2
-rw-r--r--sbin/dump/traverse.c2
-rw-r--r--sbin/init/init.c2
-rw-r--r--sbin/swapon/swapon.c2
6 files changed, 4 insertions, 12 deletions
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c
index 13d139a..8715538 100644
--- a/sbin/bsdlabel/bsdlabel.c
+++ b/sbin/bsdlabel/bsdlabel.c
@@ -50,7 +50,6 @@ static const char rcsid[] =
#endif /* not lint */
#include <sys/param.h>
-#include <sys/errno.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/wait.h>
@@ -65,6 +64,7 @@ static const char rcsid[] =
#include <stdarg.h>
#include <ctype.h>
#include <err.h>
+#include <errno.h>
#include "pathnames.h"
/*
@@ -866,8 +866,6 @@ editit()
omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP));
while ((pid = fork()) < 0) {
- extern int errno;
-
if (errno == EPROCLIM) {
warnx("you have too many processes");
return(0);
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index 13d139a..8715538 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -50,7 +50,6 @@ static const char rcsid[] =
#endif /* not lint */
#include <sys/param.h>
-#include <sys/errno.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/wait.h>
@@ -65,6 +64,7 @@ static const char rcsid[] =
#include <stdarg.h>
#include <ctype.h>
#include <err.h>
+#include <errno.h>
#include "pathnames.h"
/*
@@ -866,8 +866,6 @@ editit()
omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP));
while ((pid = fork()) < 0) {
- extern int errno;
-
if (errno == EPROCLIM) {
warnx("you have too many processes");
return(0);
diff --git a/sbin/dump/dumprmt.c b/sbin/dump/dumprmt.c
index b6563e5..ffc009d 100644
--- a/sbin/dump/dumprmt.c
+++ b/sbin/dump/dumprmt.c
@@ -63,6 +63,7 @@ static const char rcsid[] =
#include <pwd.h>
#include <stdio.h>
#ifdef __STDC__
+#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -357,7 +358,6 @@ rmtreply(cmd)
{
register char *cp;
char code[30], emsg[BUFSIZ];
- extern int errno;
rmtgets(code, sizeof (code));
if (*code == 'E' || *code == 'F') {
diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c
index 18eec04..f52413c 100644
--- a/sbin/dump/traverse.c
+++ b/sbin/dump/traverse.c
@@ -58,6 +58,7 @@ static const char rcsid[] =
#include <ctype.h>
#include <stdio.h>
#ifdef __STDC__
+#include <errno.h>
#include <string.h>
#include <unistd.h>
#endif
@@ -553,7 +554,6 @@ bread(blkno, buf, size)
int size;
{
int cnt, i;
- extern int errno;
loop:
if (lseek(diskfd, ((off_t)blkno << dev_bshift), 0) !=
diff --git a/sbin/init/init.c b/sbin/init/init.c
index 544874b..4f0dfd9 100644
--- a/sbin/init/init.c
+++ b/sbin/init/init.c
@@ -510,7 +510,6 @@ getsecuritylevel()
#ifdef KERN_SECURELVL
int name[2], curlevel;
size_t len;
- extern int errno;
name[0] = CTL_KERN;
name[1] = KERN_SECURELVL;
@@ -535,7 +534,6 @@ setsecuritylevel(newlevel)
{
#ifdef KERN_SECURELVL
int name[2], curlevel;
- extern int errno;
curlevel = getsecuritylevel();
if (newlevel == curlevel)
diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c
index 4d25da2..23b577a 100644
--- a/sbin/swapon/swapon.c
+++ b/sbin/swapon/swapon.c
@@ -97,8 +97,6 @@ main(int argc, char **argv)
int
add(char *name, int ignoreebusy)
{
- extern int errno;
-
if (swapon(name) == -1) {
switch (errno) {
case EBUSY:
OpenPOWER on IntegriCloud