summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrynet <brynet@openbsd.org>2015-03-27 04:11:25 +0000
committerbrynet <brynet@openbsd.org>2015-03-27 04:11:25 +0000
commitf6676ff6c0da89f52484d7eb260dec5fcc55f660 (patch)
treeb25f3f34e332fbb6647e511b1b1068db9c2897a3
parentMove help(1) to share/man and send the remains of man(1) to the Attic. (diff)
downloadwireguard-openbsd-f6676ff6c0da89f52484d7eb260dec5fcc55f660.tar.xz
wireguard-openbsd-f6676ff6c0da89f52484d7eb260dec5fcc55f660.zip
Some vi cleanup, unifdef's some signal blocking code that has never been
enabled in our tree, also removes some stragglers from a global struct referencing nonexistent Tcl/TK and "IP support". And finally.. deletes an empty file missed by earlier cleanup by bentley@. Inspired by and ok bcallah@
-rw-r--r--usr.bin/vi/cl/cl_bsd.c0
-rw-r--r--usr.bin/vi/common/exf.c5
-rw-r--r--usr.bin/vi/common/gs.h22
-rw-r--r--usr.bin/vi/common/line.c10
-rw-r--r--usr.bin/vi/common/recover.c5
5 files changed, 4 insertions, 38 deletions
diff --git a/usr.bin/vi/cl/cl_bsd.c b/usr.bin/vi/cl/cl_bsd.c
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/usr.bin/vi/cl/cl_bsd.c
+++ /dev/null
diff --git a/usr.bin/vi/common/exf.c b/usr.bin/vi/common/exf.c
index 044e3cf01e0..96b7c35ae43 100644
--- a/usr.bin/vi/common/exf.c
+++ b/usr.bin/vi/common/exf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exf.c,v 1.33 2015/01/16 06:40:14 deraadt Exp $ */
+/* $OpenBSD: exf.c,v 1.34 2015/03/27 04:11:25 brynet Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -822,14 +822,11 @@ file_write(SCR *sp, MARK *fm, MARK *tm, char *name, int flags)
return (1);
/* Open the file. */
- SIGBLOCK;
if ((fd = open(name, oflags,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)) < 0) {
msgq_str(sp, M_SYSERR, name, "%s");
- SIGUNBLOCK;
return (1);
}
- SIGUNBLOCK;
/* Try and get a lock. */
if (!noname && file_lock(sp, NULL, NULL, fd, 0) == LOCK_UNAVAIL)
diff --git a/usr.bin/vi/common/gs.h b/usr.bin/vi/common/gs.h
index f6c7a495a04..8d644938ecc 100644
--- a/usr.bin/vi/common/gs.h
+++ b/usr.bin/vi/common/gs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: gs.h,v 1.13 2014/11/20 08:50:53 bentley Exp $ */
+/* $OpenBSD: gs.h,v 1.14 2015/03/27 04:11:25 brynet Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -64,8 +64,6 @@ struct _gs {
SCR *ccl_sp; /* Colon command-line screen. */
void *cl_private; /* Curses support private area. */
- void *ip_private; /* IP support private area. */
- void *tk_private; /* Tk/Tcl support private area. */
/* File references. */
TAILQ_HEAD(_frefh, _fref) frefq;
@@ -192,21 +190,3 @@ struct _gs {
/* Print usage message. */
void (*scr_usage)(void);
};
-
-/*
- * XXX
- * Block signals if there are asynchronous events. Used to keep DB system calls
- * from being interrupted and not restarted, as that will result in consistency
- * problems. This should be handled by DB.
- */
-#ifdef BLOCK_SIGNALS
-#include <signal.h>
-extern sigset_t __sigblockset;
-#define SIGBLOCK \
- (void)sigprocmask(SIG_BLOCK, &__sigblockset, NULL)
-#define SIGUNBLOCK \
- (void)sigprocmask(SIG_UNBLOCK, &__sigblockset, NULL);
-#else
-#define SIGBLOCK
-#define SIGUNBLOCK
-#endif
diff --git a/usr.bin/vi/common/line.c b/usr.bin/vi/common/line.c
index d4cfe3d7092..549f79bd17d 100644
--- a/usr.bin/vi/common/line.c
+++ b/usr.bin/vi/common/line.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: line.c,v 1.13 2014/11/12 04:28:41 bentley Exp $ */
+/* $OpenBSD: line.c,v 1.14 2015/03/27 04:11:25 brynet Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -203,13 +203,11 @@ db_delete(SCR *sp, recno_t lno)
/* Update file. */
key.data = &lno;
key.size = sizeof(lno);
- SIGBLOCK;
if (ep->db->del(ep->db, &key, 0) == 1) {
msgq(sp, M_SYSERR,
"003|unable to delete line %lu", (u_long)lno);
return (1);
}
- SIGUNBLOCK;
/* Flush the cache, update line count, before screen update. */
if (lno <= ep->c_lno)
@@ -253,13 +251,11 @@ db_append(SCR *sp, int update, recno_t lno, char *p, size_t len)
key.size = sizeof(lno);
data.data = p;
data.size = len;
- SIGBLOCK;
if (ep->db->put(ep->db, &key, &data, R_IAFTER) == -1) {
msgq(sp, M_SYSERR,
"004|unable to append to line %lu", (u_long)lno);
return (1);
}
- SIGUNBLOCK;
/* Flush the cache, update line count, before screen update. */
if (lno < ep->c_lno)
@@ -323,13 +319,11 @@ db_insert(SCR *sp, recno_t lno, char *p, size_t len)
key.size = sizeof(lno);
data.data = p;
data.size = len;
- SIGBLOCK;
if (ep->db->put(ep->db, &key, &data, R_IBEFORE) == -1) {
msgq(sp, M_SYSERR,
"005|unable to insert at line %lu", (u_long)lno);
return (1);
}
- SIGUNBLOCK;
/* Flush the cache, update line count, before screen update. */
if (lno >= ep->c_lno)
@@ -387,13 +381,11 @@ db_set(SCR *sp, recno_t lno, char *p, size_t len)
key.size = sizeof(lno);
data.data = p;
data.size = len;
- SIGBLOCK;
if (ep->db->put(ep->db, &key, &data, 0) == -1) {
msgq(sp, M_SYSERR,
"006|unable to store line %lu", (u_long)lno);
return (1);
}
- SIGUNBLOCK;
/* Flush the cache, before logging or screen update. */
if (lno == ep->c_lno)
diff --git a/usr.bin/vi/common/recover.c b/usr.bin/vi/common/recover.c
index 6c95cd1479b..33c7192f070 100644
--- a/usr.bin/vi/common/recover.c
+++ b/usr.bin/vi/common/recover.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: recover.c,v 1.20 2015/01/16 06:40:14 deraadt Exp $ */
+/* $OpenBSD: recover.c,v 1.21 2015/03/27 04:11:25 brynet Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -254,15 +254,12 @@ rcv_sync(SCR *sp, u_int flags)
/* Sync the file if it's been modified. */
if (F_ISSET(ep, F_MODIFIED)) {
- SIGBLOCK;
if (ep->db->sync(ep->db, R_RECNOSYNC)) {
F_CLR(ep, F_RCV_ON | F_RCV_NORM);
msgq_str(sp, M_SYSERR,
ep->rcv_path, "060|File backup failed: %s");
- SIGUNBLOCK;
return (1);
}
- SIGUNBLOCK;
/* REQUEST: don't remove backing file on exit. */
if (LF_ISSET(RCV_PRESERVE))