summaryrefslogtreecommitdiff
path: root/x11/hanterm/patches/patch-aa
blob: 22e04dff6424653ba6478d000046464fcbebfb7b (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
$NetBSD: patch-aa,v 1.7 2013/11/24 05:53:52 dholland Exp $

- use standard headers
- build on Dragonfly
- always use mkstemp()
- declare void functions void
- avoid sys_errlist

--- misc.c.orig	2002-01-09 00:41:11.000000000 +0000
+++ misc.c
@@ -29,13 +29,14 @@
 
 #include <X11/Xos.h>
 #include <stdio.h>
+#include <string.h>
 #include <setjmp.h>
 #include <signal.h>
 #include <ctype.h>
 #include <pwd.h>
 #include <errno.h>
 
-#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DARWIN__)
+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DARWIN__) || defined(__DragonFly__)
 #include <sys/param.h>
 #endif
 
@@ -498,7 +499,7 @@ register TScreen *screen;
 			free(screen->logfile);
 		if(log_default == NULL)
 			log_default = log_def_name;
-#ifdef __linux__
+#if 1
 			mkstemp(log_default);
 #else
 			mktemp(log_default);
@@ -584,8 +585,7 @@ register TScreen *screen;
 	update_logging();
 }
 
-CloseLog(screen)
-register TScreen *screen;
+void CloseLog(TScreen *screen)
 {
 	if(!screen->logging || (screen->inhibit & I_LOG))
 		return;
@@ -897,25 +897,9 @@ int a;
 #endif	/* DEBUG */
 }
 
-#if defined(linux) && defined(__GLIBC__)
-const char *const SysErrorMsg(n)
-#else
-char *SysErrorMsg (n)
-#endif
-    int n;
+const char *const SysErrorMsg(int n)
 {
-#if defined(linux) && defined(__GLIBC__)
-    extern const char *const sys_errlist[];
-#else
-#if (defined(BSD) && (BSD >= 199306))
-    /* in *BSD, should be null because it is already declared */
-#else
-    extern char *sys_errlist[];
-#endif
-#endif
-    extern int sys_nerr;
-
-    return ((n >= 0 && n < sys_nerr) ? sys_errlist[n] : "unknown error");
+	return strerror(n);
 }