summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-save-buffer.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2014-04-07 10:32:16 +0000
committernicm <nicm@openbsd.org>2014-04-07 10:32:16 +0000
commit62e6efda5f8beacf58acaa2567f6cf0c41fc84cb (patch)
tree648384b5ca9cbe3efdf576c3526705aac17315a1 /usr.bin/tmux/cmd-save-buffer.c
parentRetire kernel support for SO_DONTROUTE, this time without breaking (diff)
downloadwireguard-openbsd-62e6efda5f8beacf58acaa2567f6cf0c41fc84cb.tar.xz
wireguard-openbsd-62e6efda5f8beacf58acaa2567f6cf0c41fc84cb.zip
save-buffer needs to use O_TRUNC.
Diffstat (limited to 'usr.bin/tmux/cmd-save-buffer.c')
-rw-r--r--usr.bin/tmux/cmd-save-buffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-save-buffer.c b/usr.bin/tmux/cmd-save-buffer.c
index 6e45c7e25b7..20755780b34 100644
--- a/usr.bin/tmux/cmd-save-buffer.c
+++ b/usr.bin/tmux/cmd-save-buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-save-buffer.c,v 1.21 2013/10/10 12:26:35 nicm Exp $ */
+/* $OpenBSD: cmd-save-buffer.c,v 1.22 2014/04/07 10:32:16 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -112,7 +112,7 @@ cmd_save_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
if (fd != -1)
f = fdopen(fd, "ab");
} else {
- fd = openat(cwd, path, O_CREAT|O_RDWR, 0600);
+ fd = openat(cwd, path, O_CREAT|O_RDWR|O_TRUNC, 0600);
if (fd != -1)
f = fdopen(fd, "wb");
}