$NetBSD: patch-ab,v 1.4 2023/07/09 22:14:42 nia Exp $ --- unix/unix.c.orig 1994-07-21 22:37:08.000000000 +0000 +++ unix/unix.c @@ -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,23 +265,15 @@ char *p; } #endif -#ifdef USG -unsigned short getuid(); -#else -#ifndef SECURE -#ifdef BSD4_3 -uid_t getuid(); -#else /* other BSD versions */ -int getuid(); -#endif -#endif -#endif +#include /* 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 +311,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 +342,6 @@ char *file; char *mode; { char buf[1024]; - extern int errno; if (tilde(file, buf)) return (fopen(buf, mode)); @@ -357,7 +356,6 @@ char *file; int flags, mode; { char buf[1024]; - extern int errno; if (tilde(file, buf)) return (open(buf, flags, mode));