summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Leres <leres@FreeBSD.org>2019-03-21 17:12:16 +0000
committerCraig Leres <leres@FreeBSD.org>2019-03-21 17:12:16 +0000
commitc8ced0504ae7f2cea01cd2374fc9f2b9e1a49c22 (patch)
tree5b0790380cb992454fbfabffdbc66f888fac5875
parentsysutils/tree: update to 1.8.0 (diff)
Unlike the base vi (nvi 2.1.3), nvi-devel calls flock() on a writable
file descriptor. This has the unfortunately side effect of causing the "Text file busy" error when you edit a script in one window and try to run it in another. The fix is to change the initial open() just prior to calling file_lock() in file_init() to use O_RDONLY instead of O_RDWR. This does not impact nvi's ability to write files, nvi creates a new file when writing. PR: 235445 Approved by: johans (maintainer timeout, 6 weeks), ler (mentor, implicit)
Notes
Notes: svn path=/head/; revision=496474
-rw-r--r--editors/nvi-devel/Makefile2
-rw-r--r--editors/nvi-devel/files/patch-common_exf.c11
2 files changed, 12 insertions, 1 deletions
diff --git a/editors/nvi-devel/Makefile b/editors/nvi-devel/Makefile
index 0b66789b215a..29a626b4d7ae 100644
--- a/editors/nvi-devel/Makefile
+++ b/editors/nvi-devel/Makefile
@@ -3,7 +3,7 @@
PORTNAME= nvi
PORTVERSION= 1.81.6
-PORTREVISION= 10
+PORTREVISION= 11
CATEGORIES= editors
MASTER_SITES= ftp://ftp.stack.nl/pub/users/johans/nvi/
diff --git a/editors/nvi-devel/files/patch-common_exf.c b/editors/nvi-devel/files/patch-common_exf.c
new file mode 100644
index 000000000000..8d725050fe26
--- /dev/null
+++ b/editors/nvi-devel/files/patch-common_exf.c
@@ -0,0 +1,11 @@
+--- ../common/exf.c.orig 2007-11-18 16:41:42 UTC
++++ ../common/exf.c
+@@ -392,7 +392,7 @@ postinit:
+ * an error.
+ */
+ if (rcv_name == NULL && ep->refcnt == 0) {
+- if ((ep->fd = open(oname, O_RDWR)) == -1)
++ if ((ep->fd = open(oname, O_RDONLY)) == -1)
+ goto no_lock;
+
+ switch (file_lock(sp, oname, &ep->fcntl_fd, ep->fd, 1)) {