diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2021-02-11 09:03:39 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2021-02-11 09:03:39 +0000 |
commit | d99f6602349297209c4deec4714adfc436720dd2 (patch) | |
tree | ea596bf9324bdef1ff7dda1141506a6f6a900a53 /usr.bin | |
parent | f5043351ef10f5a2afeff508be80de9513e6a850 (diff) |
O_TRUNC is needed in case file exists.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/cmd-save-buffer.c | 4 |
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 cb968126bad..96194a5a0f8 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.51 2020/07/21 05:24:33 nicm Exp $ */ +/* $OpenBSD: cmd-save-buffer.c,v 1.52 2021/02/11 09:03:38 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org> @@ -109,7 +109,7 @@ cmd_save_buffer_exec(struct cmd *self, struct cmdq_item *item) if (args_has(args, 'a')) flags = O_APPEND; else - flags = 0; + flags = O_TRUNC; file_write(cmdq_get_client(item), path, flags, bufdata, bufsize, cmd_save_buffer_done, item); free(path); |