summaryrefslogtreecommitdiff
path: root/games/moria/patches/patch-ab
blob: 3f6f9e2263c0b320a47369fdac98eb21add294b7 (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
74
75
76
77
$NetBSD: patch-ab,v 1.3 2007/03/06 23:25:48 rillig Exp $

--- unix/unix.c.orig	1994-07-22 00:37:08.000000000 +0200
+++ unix/unix.c	2007-03-07 00:08:23.142229936 +0100
@@ -43,6 +43,11 @@ typedef struct { int stuff; } fpvmach;
 #include <sys/param.h>
 #endif
 
+#if (defined(BSD) && BSD >= 199306)
+#include <fcntl.h>
+#include <unistd.h>
+#endif
+
 #ifdef __linux__
 #include <sys/time.h>
 #include <sys/types.h>
@@ -73,7 +78,7 @@ typedef struct { int stuff; } fpvmach;
 #include "externs.h"
 
 #include <pwd.h>
-#include <sys/errno.h>
+#include <errno.h>
 
 #ifdef USG
 struct passwd *getpwuid();
@@ -260,6 +265,7 @@ char *p;
 }
 #endif
 
+#if 0
 #ifdef USG
 unsigned short getuid();
 #else
@@ -271,12 +277,15 @@ int getuid();
 #endif
 #endif
 #endif
+#endif
 
 /* 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 +323,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 +354,6 @@ char *file;
 char *mode;
 {
   char buf[1024];
-  extern int errno;
 
   if (tilde(file, buf))
     return (fopen(buf, mode));
@@ -357,7 +368,6 @@ char *file;
 int flags, mode;
 {
   char buf[1024];
-  extern int errno;
 
   if (tilde(file, buf))
     return (open(buf, flags, mode));