eac17aff3a
archivers/zip way back in 2000. Add modern termios support to make the encryption code build on more platforms.
87 lines
2 KiB
Text
87 lines
2 KiB
Text
$NetBSD: patch-aa,v 1.3 2004/11/23 02:42:10 tv Exp $
|
|
|
|
--- fileio.c.orig Sat Aug 29 21:51:00 1992
|
|
+++ fileio.c
|
|
@@ -59,16 +59,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 +67,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 +95,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 +198,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 +211,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 +220,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 */
|
|
|
|
|