summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2012-10-22 08:22:04 +0000
committerflorian <florian@openbsd.org>2012-10-22 08:22:04 +0000
commitb9d70300340519e4a3bbd74f6692dfc375104c7a (patch)
tree1acf314c5e3cf1ff3d4a92f35bb797aed8165484
parentUnfortunately "ospf6ctl show fib" printed embedded scopes as the (diff)
downloadwireguard-openbsd-b9d70300340519e4a3bbd74f6692dfc375104c7a.tar.xz
wireguard-openbsd-b9d70300340519e4a3bbd74f6692dfc375104c7a.zip
Check for dirty buffer on buffer change.
ok jasper@, benno@
-rw-r--r--usr.bin/mg/buffer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/mg/buffer.c b/usr.bin/mg/buffer.c
index 0cc85f20efe..5f3330c3ee1 100644
--- a/usr.bin/mg/buffer.c
+++ b/usr.bin/mg/buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buffer.c,v 1.82 2012/10/12 21:13:46 jasper Exp $ */
+/* $OpenBSD: buffer.c,v 1.83 2012/10/22 08:22:04 florian Exp $ */
/* This file is in the public domain. */
@@ -850,7 +850,11 @@ int
checkdirty(struct buffer *bp)
{
int s;
-
+
+ if ((bp->b_flag & (BFCHG | BFDIRTY)) == 0)
+ if (fchecktime(bp) != TRUE)
+ bp->b_flag |= BFDIRTY;
+
if ((bp->b_flag & (BFDIRTY | BFIGNDIRTY)) == BFDIRTY) {
if ((s = eyorn("File changed on disk; really edit the buffer"))
!= TRUE)