$NetBSD: patch-ab,v 1.3 2007/03/06 23:25:48 rillig Exp $ --- unix/unix.c.orig 1994-07-22 00:37:08.000000000 +0200 +++ unix/unix.c 2007-03-07 00:08:23.142229936 +0100 @@ -43,6 +43,11 @@ typedef struct { int stuff; } fpvmach; #include #endif +#if (defined(BSD) && BSD >= 199306) +#include +#include +#endif + #ifdef __linux__ #include #include @@ -73,7 +78,7 @@ typedef struct { int stuff; } fpvmach; #include "externs.h" #include -#include +#include #ifdef USG struct passwd *getpwuid(); @@ -260,6 +265,7 @@ char *p; } #endif +#if 0 #ifdef USG unsigned short getuid(); #else @@ -271,12 +277,15 @@ int getuid(); #endif #endif #endif +#endif /* Find a default user name from the system. */ void user_name(buf) char *buf; { +#if !(defined(BSD) && BSD >= 199306) extern char *getlogin(); +#endif struct passwd *pwline; register char *p; @@ -314,7 +323,10 @@ char *file, *exp; user[i] = '\0'; if (i == 0) { - char *login = (char *) getlogin(); +#if !(defined(BSD) && BSD >= 199306) + extern char *getlogin(); +#endif + char *login = getlogin(); if (login != NULL) (void) strcpy (user, login); @@ -342,7 +354,6 @@ char *file; char *mode; { char buf[1024]; - extern int errno; if (tilde(file, buf)) return (fopen(buf, mode)); @@ -357,7 +368,6 @@ char *file; int flags, mode; { char buf[1024]; - extern int errno; if (tilde(file, buf)) return (open(buf, flags, mode));