summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2015-10-04 15:03:24 +0000
committermillert <millert@openbsd.org>2015-10-04 15:03:24 +0000
commitf112db334da5cceeb29565861c9ad97e1826efb5 (patch)
tree101cbab0c2070abf86b3f9c9986b94fd9bfd72ac
parentafter dd has opened it's files and done the tape positioning ioctl, we (diff)
downloadwireguard-openbsd-f112db334da5cceeb29565861c9ad97e1826efb5.tar.xz
wireguard-openbsd-f112db334da5cceeb29565861c9ad97e1826efb5.zip
Remove #ifdefs for non-POSIX systems. Also remove #ifdef for
SIGWINCH, it is not POSIX but it is a defacto standard. OK deraadt@
-rw-r--r--bin/ed/ed.h8
-rw-r--r--bin/ed/main.c19
2 files changed, 4 insertions, 23 deletions
diff --git a/bin/ed/ed.h b/bin/ed/ed.h
index fceb797bc19..25dffc6404c 100644
--- a/bin/ed/ed.h
+++ b/bin/ed/ed.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ed.h,v 1.16 2015/07/14 19:16:33 deraadt Exp $ */
+/* $OpenBSD: ed.h,v 1.17 2015/10/04 15:03:24 millert Exp $ */
/* $NetBSD: ed.h,v 1.23 1995/03/21 09:04:40 cgd Exp $ */
/* ed.h: type and constant definitions for the ed editor. */
@@ -46,11 +46,7 @@
#define MINBUFSZ 512 /* minimum buffer size - must be > 0 */
#define SE_MAX 30 /* max subexpressions in a regular expression */
-#ifdef INT_MAX
-# define LINECHARS INT_MAX /* max chars per line */
-#else
-# define LINECHARS MAXINT /* max chars per line */
-#endif
+#define LINECHARS INT_MAX /* max chars per line */
/* gflags */
#define GLB 001 /* global command */
diff --git a/bin/ed/main.c b/bin/ed/main.c
index c678d8f7c1e..37ece8058b7 100644
--- a/bin/ed/main.c
+++ b/bin/ed/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.46 2015/07/28 17:46:52 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.47 2015/10/04 15:03:24 millert Exp $ */
/* $NetBSD: main.c,v 1.3 1995/03/21 09:04:44 cgd Exp $ */
/* main.c: This file contains the main control and user-interface routines
@@ -52,11 +52,7 @@
#include "ed.h"
-#ifdef _POSIX_SOURCE
sigjmp_buf env;
-#else
-jmp_buf env;
-#endif
/* static buffers */
char stdinbuf[1]; /* stdin buffer */
@@ -149,21 +145,14 @@ top:
}
/* assert: reliable signals! */
-#ifdef SIGWINCH
if (isatty(STDIN_FILENO)) {
handle_winch(SIGWINCH);
signal(SIGWINCH, handle_winch);
}
-#endif
signal(SIGHUP, signal_hup);
signal(SIGQUIT, SIG_IGN);
signal(SIGINT, signal_int);
-#ifdef _POSIX_SOURCE
- if (status = sigsetjmp(env, 1))
-#else
- if ((status = setjmp(env)) != 0)
-#endif
- {
+ if (status = sigsetjmp(env, 1)) {
fputs("\n?\n", stderr);
seterrmsg("interrupt");
} else {
@@ -1405,11 +1394,7 @@ handle_int(int signo)
if (!sigactive)
_exit(1);
sigint = 0;
-#ifdef _POSIX_SOURCE
siglongjmp(env, -1);
-#else
- longjmp(env, -1);
-#endif
}