From ca7aa695978909c4a9715c00dce6658aac26a1a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 2 Sep 2020 18:43:11 +0200 Subject: [PATCH] ffiwrapper: More correct error check on openPartialFile --- extern/sector-storage/ffiwrapper/sealer_cgo.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extern/sector-storage/ffiwrapper/sealer_cgo.go b/extern/sector-storage/ffiwrapper/sealer_cgo.go index c4e5511d1..d4f796dcb 100644 --- a/extern/sector-storage/ffiwrapper/sealer_cgo.go +++ b/extern/sector-storage/ffiwrapper/sealer_cgo.go @@ -372,6 +372,10 @@ func (sb *Sealer) ReadPiece(ctx context.Context, writer io.Writer, sector abi.Se pf, err := openPartialFile(maxPieceSize, path.Unsealed) if err != nil { + if xerrors.Is(err, os.ErrNotExist) { + return false, nil + } + return false, xerrors.Errorf("opening partial file: %w", err) }