$NetBSD$

--- base/libmisc/chowntty.c.orig	2006-05-09 18:12:33.000000000 +0000
+++ base/libmisc/chowntty.c
@@ -35,6 +35,7 @@ RCSID("$Id: chowntty.c,v 1.3 1997/05/01 
 #include <sys/types.h>
 #include <sys/stat.h>
 
+#include <errno.h>
 #include <stdio.h>
 #include <grp.h>
 
@@ -72,7 +73,6 @@ chown_tty(tty, info)
 	const char *tty;
 	const struct passwd *info;
 {
-	extern	int	errno;
 	char	buf[BUFSIZ];
 	char	*group;		/* TTY group name or number */
 	struct	group	*grent;
