From edda09df00b77daa23caa9ec431a1cff3593b80d Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Tue, 9 Oct 2018 07:03:06 -0700 Subject: [PATCH] fix file descriptor --- src/recipient/recipient.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/recipient/recipient.go b/src/recipient/recipient.go index 12e618c1..fa4fc9cb 100644 --- a/src/recipient/recipient.go +++ b/src/recipient/recipient.go @@ -259,7 +259,7 @@ func receive(forceSend int, serverAddress string, tcpPorts []string, isLocal boo var fProgress *os.File var progressErr error if resumeFile { - fProgress, progressErr = os.OpenFile(progressFile, os.O_APPEND, 0644) + fProgress, progressErr = os.OpenFile(progressFile, os.O_APPEND|os.O_WRONLY, 0644) bytesWritten = len(blocks) * blockSize } else { os.Remove(progressFile) @@ -321,11 +321,11 @@ func receive(forceSend int, serverAddress string, tcpPorts []string, isLocal boo log.Debugf("writing to location %d (%2.0f/%2.0f)", bytesWritten, blocksWritten, blocksToWrite) fProgress.WriteString(fmt.Sprintf("%d\n", bytesWritten)) } - if err != nil { log.Error(err) return err } + // update the bytes written bytesWritten += n blocksWritten += 1.0