summaryrefslogtreecommitdiff
path: root/archivers/zip1/patches/patch-aa
blob: c68f1ec1a920079eb8fdb94549d83c3d752007f1 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
$NetBSD: patch-aa,v 1.4 2005/10/03 20:34:56 joerg Exp $

--- fileio.c.orig	1992-08-29 21:51:00.000000000 +0000
+++ fileio.c
@@ -38,7 +38,6 @@
 #    define MATCH dosmatch
 #  endif /* ?OS2 */
 #else /* !MSDOS */
-   extern int errno;    /* error number from system functions */
 #  ifdef VMS
 #    define RMDIR
 #    define link rename
@@ -59,16 +58,6 @@
 #endif /* ?VMS */
 
 
-/* For now, assume DIRENT implies System V implies TERMIO */
-#ifdef DIRENT
-#  ifndef MINIX
-#    ifndef TERMIO
-#      define TERMIO
-#    endif /* !TERMIO */
-#  endif /* !MINIX */
-#endif /* DIRENT */
-
-
 #ifndef EXPORT
 #  ifdef MSVMS
 #    ifdef MSDOS
@@ -77,7 +66,13 @@
 #      define getch() getc(stderr)
 #    endif /* ?MSDOS */
 #  else /* !MSVMS */
-#    ifdef TERMIO       /* Amdahl, Cray, all SysV? */
+#    if defined(TERMIOS)
+#      include <termios.h>
+#      define sgttyb termios
+#      define sg_flags c_lflag
+#      define GTTY(f, s) tcgetattr(f, (void *) s)
+#      define STTY(f, s) tcsetattr(f, TCSAFLUSH, (void *) s)
+#    elif defined(TERMIO)       /* Amdahl, Cray, all SysV? */
 #      ifdef CONVEX
 #        include <sys/termios.h>
 #        include <sgtty.h>
@@ -99,11 +94,16 @@
 #      define GTTY gtty
 #      define STTY stty
 #    endif /* ?TERMIO */
+#ifdef MODERN
+#include <fcntl.h>
+#include <unistd.h>
+#else
      int isatty OF((int));
      char *ttyname OF((int));
      int open OF((char *, int, ...));
      int close OF((int));
      int read OF((int, voidp *, int));
+#endif
 #  endif /* ?MSVMS */
 #endif /* !EXPORT */
 
@@ -197,6 +197,9 @@
 #endif /* !UTIL */
 
 
+#ifdef MODERN
+#include <unistd.h>
+#else
 /* Library functions not in (most) header files */
 char *mktemp OF((char *));
 int link OF((char *, char *));
@@ -207,6 +210,7 @@ int unlink OF((char *));
     * parameter is an unsigned long.
     */
 #endif /* !CONVEX */
+#endif
 
 
 #ifndef UTIL    /* the companion #endif is a bit of ways down ... */
@@ -215,11 +219,15 @@ int unlink OF((char *));
    int utime OF((char *, time_t *));
 #endif /* !__TURBOC__ */
 #ifndef MSDOS
+#ifdef MODERN
+#include <fcntl.h>
+#else
    int open OF((char *, int, ...));
    int close OF((int));
 #  ifndef RMDIR
      int rmdir OF((char *));
 #  endif /* !RMDIR */
+#endif
 #endif /* !MSDOS */