summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2015-04-19 01:10:59 +0000
committermillert <millert@openbsd.org>2015-04-19 01:10:59 +0000
commit622a37692318a83b9e81e6674180a5cc98a15cfd (patch)
tree09fcf4836b8ce3b70136d620261c342000d61e74
parentForce the boot partition to ext2fs, rathern than leaving it as it was. (diff)
downloadwireguard-openbsd-622a37692318a83b9e81e6674180a5cc98a15cfd.tar.xz
wireguard-openbsd-622a37692318a83b9e81e6674180a5cc98a15cfd.zip
Don't lock the file for "vi -R" or "view". OK deraadt@
-rw-r--r--usr.bin/vi/common/exf.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/usr.bin/vi/common/exf.c b/usr.bin/vi/common/exf.c
index 96b7c35ae43..43d14008859 100644
--- a/usr.bin/vi/common/exf.c
+++ b/usr.bin/vi/common/exf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exf.c,v 1.34 2015/03/27 04:11:25 brynet Exp $ */
+/* $OpenBSD: exf.c,v 1.35 2015/04/19 01:10:59 millert Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -333,7 +333,7 @@ file_init(SCR *sp, FREF *frp, char *rcv_name, int flags)
* when locking is a little more reliable, this should change to be
* an error.
*/
- if (rcv_name == NULL)
+ if (rcv_name == NULL && !O_ISSET(sp, O_READONLY))
switch (file_lock(sp, oname,
&ep->fcntl_fd, ep->db->fd(ep->db), 0)) {
case LOCK_FAILED:
@@ -341,10 +341,8 @@ file_init(SCR *sp, FREF *frp, char *rcv_name, int flags)
break;
case LOCK_UNAVAIL:
readonly = 1;
- if (!O_ISSET(sp, O_READONLY)) {
- msgq_str(sp, M_INFO, oname,
- "239|%s already locked, session is read-only");
- }
+ msgq_str(sp, M_INFO, oname,
+ "239|%s already locked, session is read-only");
break;
case LOCK_SUCCESS:
break;