From 2aa26082f8c9fc272630d73618bf1afbcc5f065c Mon Sep 17 00:00:00 2001 From: Justin Berger Date: Mon, 15 Feb 2016 12:00:03 -0700 Subject: [PATCH] Added O_TRUNC flag so new format installation doesn't result in trailing garbage message --- src/lnav.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lnav.cc b/src/lnav.cc index ab6dc32b..34b7fa8f 100644 --- a/src/lnav.cc +++ b/src/lnav.cc @@ -2392,7 +2392,7 @@ int main(int argc, char *argv[]) perror("unable to open file to install"); } else if ((out_fd = open(dst_path.c_str(), - O_WRONLY | O_CREAT, 0644)) == -1) { + O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1) { fprintf(stderr, "error: unable to open destination: %s -- %s\n", dst_path.c_str(), strerror(errno)); }