pkgsrc/misc/screen/patches/patch-ai
rumko 27caa697d1 misc/screen: DragonFly BSD 2.9+ support
Make screen use utmpx on DragonFly BSD 2.9+ so that it compiles
again.

Patch submitted by Matthias Rampke ( https://gist.github.com/823307 ).

ok@ wiz
2011-03-14 06:15:23 +00:00

35 lines
1 KiB
Text

$NetBSD: patch-ai,v 1.3 2011/03/14 06:15:23 rumko Exp $
--- os.h.orig 2002-01-08 15:42:33.000000000 +0000
+++ os.h
@@ -62,9 +62,6 @@
# undef exit
#endif /* sun */
-#ifndef linux /* all done in <errno.h> */
-extern int errno;
-#endif /* linux */
#ifndef HAVE_STRERROR
/* No macros, please */
#undef strerror
@@ -260,9 +257,18 @@
#endif
#if defined(UTMPOK) || defined(BUGGYGETLOGIN)
-# if defined(SVR4) && !defined(DGUX) && !defined(__hpux) && !defined(linux)
+# if (defined(SVR4) && !defined(DGUX) && !defined(__hpux) && !defined(linux)) \
+ || (defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106050000)) \
+ || (defined(__DragonFly__) && (__DragonFly_version >= 200902))
# include <utmpx.h>
-# define UTMPFILE UTMPX_FILE
+# if defined(__NetBSD__)
+# define UTMPFILE _PATH_UTMPX
+# define NetBSD_UTMP
+# elif defined(__DragonFly__)
+# define UTMPFILE _PATH_UTMPX
+# else
+# define UTMPFILE UTMPX_FILE
+# endif
# define utmp utmpx
# define getutent getutxent
# define getutid getutxid