From 9049263f6fd8c4bc94406ee7343f6563c498ba07 Mon Sep 17 00:00:00 2001 From: ckolivas Date: Thu, 17 Mar 2011 17:36:52 +1100 Subject: [PATCH] Make fd_out read/write in preparation for reading, encrypting, and then writing header data back. --- lrzip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lrzip.c b/lrzip.c index 199a513..086c3a6 100644 --- a/lrzip.c +++ b/lrzip.c @@ -1027,9 +1027,9 @@ void compress_file(rzip_control *control) } if (FORCE_REPLACE) - fd_out = open(control->outfile, O_WRONLY | O_CREAT | O_TRUNC, 0666); + fd_out = open(control->outfile, O_RDWR | O_CREAT | O_TRUNC, 0666); else - fd_out = open(control->outfile, O_WRONLY | O_CREAT | O_EXCL, 0666); + fd_out = open(control->outfile, O_RDWR | O_CREAT | O_EXCL, 0666); if (unlikely(fd_out == -1)) { /* We must ensure we don't delete a file that already * exists just because we tried to create a new one */