summaryrefslogtreecommitdiff
path: root/misc/screen/patches/patch-ai
blob: 8402d3f16074942a87138d43deef6986a2507eba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
$NetBSD: patch-ai,v 1.8 2017/07/18 23:02:18 kim Exp $

This glues in the code from patch-am (see also patch-al and patch-an).

--- os.h.orig	2016-06-19 19:41:03.000000000 +0000
+++ os.h
@@ -71,9 +71,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
@@ -250,9 +247,15 @@ extern int errno;
 #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>
+#if defined(UTMPX_FILE) /* GNU extension */
 #  define UTMPFILE	UTMPX_FILE
+#elif defined(_PATH_UTMPX)
+#  define UTMPFILE	_PATH_UTMPX
+#endif
 #  define utmp		utmpx
 #  define getutent	getutxent
 #  define getutid	getutxid
@@ -261,6 +264,9 @@ extern int errno;
 #  define setutent	setutxent
 #  define endutent	endutxent
 #  define ut_time	ut_xtime
+#  if defined(__NetBSD__)
+#    define NetBSD_UTMP
+#  endif
 # else /* SVR4 */
 #  include <utmp.h>
 # endif /* SVR4 */