Include appropriate header files to bring prototypes into scope.

Removed explicit errno declarations.
This commit is contained in:
jtc 1996-05-07 18:32:22 +00:00
parent 4a22fd1c39
commit 273e6cc624
5 changed files with 15 additions and 19 deletions

4
usr.bin/env/env.c vendored
View File

@ -39,7 +39,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "@(#)env.c 8.3 (Berkeley) 4/2/94";*/
static char rcsid[] = "$NetBSD: env.c,v 1.8 1995/09/28 07:34:39 perry Exp $";
static char rcsid[] = "$NetBSD: env.c,v 1.9 1996/05/07 18:32:22 jtc Exp $";
#endif /* not lint */
#include <err.h>
@ -58,7 +58,7 @@ main(argc, argv)
char **argv;
{
extern char **environ;
extern int errno, optind;
extern int optind;
char **ep, *p;
char *cleanenv[1];
int ch;

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)display.c 5.11 (Berkeley) 3/9/91";*/
static char rcsid[] = "$Id: display.c,v 1.2 1993/08/01 18:14:49 mycroft Exp $";
static char rcsid[] = "$Id: display.c,v 1.3 1996/05/07 18:32:24 jtc Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -279,7 +279,7 @@ extern off_t skip; /* bytes to skip */
next(argv)
char **argv;
{
extern int errno, exitval;
extern int exitval;
static int done;
int statok;
@ -316,7 +316,6 @@ doskip(fname, statok)
char *fname;
int statok;
{
extern int errno;
struct stat sbuf;
if (statok) {
@ -354,8 +353,6 @@ emalloc(size)
nomem()
{
extern int errno;
(void)fprintf(stderr, "hexdump: %s.\n", strerror(errno));
exit(1);
}

View File

@ -39,11 +39,12 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)hexdump.c 5.5 (Berkeley) 6/1/90";*/
static char rcsid[] = "$Id: hexdump.c,v 1.2 1993/08/01 18:14:48 mycroft Exp $";
static char rcsid[] = "$Id: hexdump.c,v 1.3 1996/05/07 18:32:26 jtc Exp $";
#endif /* not lint */
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include "hexdump.h"
FS *fshead; /* head of format strings */
@ -55,11 +56,10 @@ main(argc, argv)
int argc;
char **argv;
{
extern int errno;
register FS *tfs;
char *p, *rindex();
char *p;
if (!(p = rindex(argv[0], 'o')) || strcmp(p, "od"))
if (!(p = strrchr(argv[0], 'o')) || strcmp(p, "od"))
newsyntax(argc, &argv);
else
oldsyntax(argc, &argv);

View File

@ -43,7 +43,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)indent.c 5.16 (Berkeley) 2/26/91";*/
static char rcsid[] = "$Id: indent.c,v 1.2 1993/08/01 18:14:33 mycroft Exp $";
static char rcsid[] = "$Id: indent.c,v 1.3 1996/05/07 18:32:28 jtc Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -55,6 +55,7 @@ static char rcsid[] = "$Id: indent.c,v 1.2 1993/08/01 18:14:33 mycroft Exp $";
#include "indent_globs.h"
#include "indent_codes.h"
#include <ctype.h>
#include <errno.h>
char *in_name = "Standard Input"; /* will always point to name of input
* file */
@ -1174,9 +1175,6 @@ bakcopy()
err(msg)
char *msg;
{
extern int errno;
char *strerror();
(void)fprintf(stderr, "indent: %s: %s\n", msg, strerror(errno));
exit(1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: lock.c,v 1.7 1995/06/27 00:16:17 jtc Exp $ */
/* $NetBSD: lock.c,v 1.8 1996/05/07 18:32:31 jtc Exp $ */
/*
* Copyright (c) 1980, 1987, 1993
@ -46,7 +46,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)lock.c 8.1 (Berkeley) 6/6/93";
#endif
static char rcsid[] = "$NetBSD: lock.c,v 1.7 1995/06/27 00:16:17 jtc Exp $";
static char rcsid[] = "$NetBSD: lock.c,v 1.8 1996/05/07 18:32:31 jtc Exp $";
#endif /* not lint */
/*
@ -66,8 +66,10 @@ static char rcsid[] = "$NetBSD: lock.c,v 1.7 1995/06/27 00:16:17 jtc Exp $";
#include <err.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#define TIMEOUT 15
@ -84,7 +86,6 @@ main(argc, argv)
char **argv;
{
extern char *optarg;
extern int errno, optind;
struct passwd *pw;
struct timeval timval;
struct itimerval ntimer, otimer;
@ -93,7 +94,7 @@ main(argc, argv)
int ch, sectimeout, usemine;
char *ap, *mypw, *ttynam, *tzn;
char hostname[MAXHOSTNAMELEN], s[BUFSIZ], s1[BUFSIZ];
char *crypt(), *ttyname();
char *crypt();
sectimeout = TIMEOUT;
mypw = NULL;