#include <errno.h> where needed. Kill extern int errno;.

Minor warnings in tip corrected.
This commit is contained in:
Warner Losh 2000-04-14 06:39:19 +00:00
parent 37736675d1
commit 0e7f0658ee
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=59217
16 changed files with 32 additions and 21 deletions

View File

@ -29,6 +29,8 @@
* 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.
*
* $FreeBSD$
*/
#ifndef lint
@ -65,7 +67,6 @@ setfile(name)
char *who = name[1] ? name + 1 : myname;
static int shudclob;
extern char *tempMesg;
extern int errno;
if ((name = expand(name)) == NOSTR)
return -1;

View File

@ -69,7 +69,6 @@ static const char rcsid[] =
#include "hash.h"
#include "dir.h"
#include "job.h"
extern int errno;
/*
* The following array is used to make a fast determination of which

View File

@ -7,6 +7,7 @@ static char rcsid[] = "$FreeBSD$";
#endif
#include <stdio.h>
#include <errno.h>
#include "make.h"
#if !__STDC__
@ -16,9 +17,6 @@ static char rcsid[] = "$FreeBSD$";
#endif
#ifdef sun
extern int errno, sys_nerr;
extern char *sys_errlist[];
@ -182,7 +180,6 @@ getwd(pathname)
{
DIR *dp;
struct dirent *d;
extern int errno;
struct stat st_root, st_cur, st_next, st_dotdot;
char pathbuf[MAXPATHLEN], nextpathbuf[MAXPATHLEN * 2];

View File

@ -30,6 +30,8 @@
* 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.
*
* $FreeBSD$
*/
#ifndef lint
@ -51,6 +53,7 @@ static char sccsid[] = "@(#)os.c 8.1 (Berkeley) 6/6/93";
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/file.h>
#include <errno.h>
#include <signal.h>
#include <setjmp.h>
#include <stdio.h>
@ -250,7 +253,6 @@ bad_file(filename, message, len)
char *filename, *message;
u_int len;
{
extern int errno;
struct stat statbuf;
char *strcat(), *strerror();

View File

@ -50,6 +50,7 @@ static const char rcsid[] =
#include <sys/resource.h>
#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <pwd.h>
@ -124,7 +125,6 @@ donice(which, who, prio)
int which, who, prio;
{
int oldprio;
extern int errno;
errno = 0, oldprio = getpriority(which, who);
if (oldprio == -1 && errno) {

View File

@ -58,6 +58,7 @@ static const char rcsid[] =
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <nlist.h>
#include <paths.h>
#include <signal.h>
@ -731,7 +732,6 @@ getinfo(s, st)
{
struct devinfo *tmp_dinfo;
int mib[2], size;
extern int errno;
NREAD(X_CPTIME, s->time, sizeof s->time);
NREAD(X_CPTIME, cur.cp_time, sizeof(cur.cp_time));

View File

@ -29,6 +29,8 @@
* 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.
*
* $FreeBSD$
*/
#ifndef lint
@ -40,6 +42,7 @@ static char sccsid[] = "@(#)dn11.c 8.1 (Berkeley) 6/6/93";
*/
#include "tipconf.h"
#include "tip.h"
#include <errno.h>
int dn_abort();
void alarmtr();
@ -49,7 +52,6 @@ static int child = -1, dn;
dn_dialer(num, acu)
char *num, *acu;
{
extern errno;
char *p, *q, phone[40];
int lt, nw, connected = 1;
register int timelim;

View File

@ -29,6 +29,8 @@
* 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.
*
* $FreeBSD$
*/
#ifndef lint
@ -40,10 +42,10 @@ static char sccsid[] = "@(#)v831.c 8.1 (Berkeley) 6/6/93";
*/
#include "tipconf.h"
#include "tip.h"
#include <errno.h>
int v831_abort();
static void alarmtr();
extern int errno;
static jmp_buf jmpbuf;
static int child = -1;

View File

@ -725,7 +725,7 @@ tiplink (char *cmd, unsigned int flags)
* 1 <-> remote tty out
* 2 <-> local tty out
*/
void
int
consh(c)
{
char buf[256];
@ -733,6 +733,7 @@ consh(c)
if (prompt("Local command? ", buf, sizeof(buf)))
return;
tiplink (buf, TL_SIGNAL_TIPOUT | TL_VERBOSE);
return 0;
}
#endif

View File

@ -58,6 +58,7 @@ void ttysetup (int speed);
*/
#include <err.h>
#include <errno.h>
#include <sys/types.h>
#include <libutil.h>
#include "tipconf.h"
@ -666,7 +667,6 @@ xpwrite(fd, buf, n)
{
register int i;
register char *bp;
extern int errno;
bp = buf;
if (bits8 == 0)

View File

@ -32,6 +32,8 @@
* SUCH DAMAGE.
*
* @(#)tip.h 8.1 (Berkeley) 6/6/93
*
* $FreeBSD$
*/
/*
@ -318,7 +320,7 @@ extern void shell_uid __P((void));
extern void unraw __P((void));
extern void xpwrite __P((int, char *, int));
extern int prompt __P((char *, char *, size_t));
extern void consh __P((int));
extern int consh __P((int));
extern void tipabort __P((char *));
#define TL_VERBOSE 0x00000001

View File

@ -40,6 +40,7 @@ static const char rcsid[] =
#endif /* not lint */
#include "tip.h"
#include <errno.h>
/*
* tip
*
@ -122,7 +123,6 @@ tipout()
char buf[BUFSIZ];
register char *cp;
register int cnt;
extern int errno;
int omask;
signal(SIGINT, SIG_IGN);

View File

@ -185,7 +185,7 @@ vtoken(s)
if ((p = vlookup(s))) {
cp++;
if (p->v_type&NUMBER)
vassign(p, atoi(cp));
vassign(p, (char *) atoi(cp));
else {
if (strcmp(s, "record") == 0)
cp = expand(cp);
@ -358,7 +358,7 @@ vstring(s,v)
if (p == 0)
return (1);
if (p->v_type&NUMBER)
vassign(p, atoi(v));
vassign(p, (char *) atoi(v));
else {
if (strcmp(s, "record") == 0)
v = expand(v);

View File

@ -32,6 +32,8 @@
* 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.
*
* $FreeBSD$
*/
#ifndef lint
@ -40,7 +42,7 @@ static char sccsid[] = "@(#)ttoutput.c 8.1 (Berkeley) 6/6/93";
#include "ww.h"
#include "tt.h"
#include <sys/errno.h>
#include <errno.h>
/*
* Buffered output package.
@ -51,7 +53,6 @@ ttflush()
{
register char *p;
register n = tt_obp - tt_ob;
extern errno;
if (n == 0)
return;

View File

@ -32,6 +32,8 @@
* 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.
*
* $FreeBSD$
*/
#ifndef lint
@ -39,13 +41,13 @@ static char sccsid[] = "@(#)wwchild.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#include "ww.h"
#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
void
wwchild()
{
extern errno;
int olderrno;
register struct ww **wp;
union wait w;

View File

@ -32,18 +32,20 @@
* 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.
*
* $FreeBSD$
*/
#ifndef lint
static char sccsid[] = "@(#)wwerror.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#include <errno.h>
#include "ww.h"
char *
wwerror()
{
extern int errno;
char *strerror();
switch (wwerrno) {