Add include of errno.h where needed, remove extern int errno where not.

These commits were inspired by a similar commit to netbsd.
This commit is contained in:
Warner Losh 2000-04-14 06:15:01 +00:00
parent 71e93b3961
commit 37736675d1
6 changed files with 4 additions and 12 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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') {

View File

@ -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) !=

View File

@ -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)

View File

@ -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: