"vscode:/vscode.git/clone" did not exist on "6b915672f4091caebe802522f9c076c0cd15ab88"
Commit 2fa1db43 authored by Daniel Hiltgen's avatar Daniel Hiltgen
Browse files

Don't hard fail on sparse setup error

It seems this can fail in some casees, but proceed
with the download anyway.
parent e9aa5117
...@@ -216,9 +216,7 @@ func (b *blobDownload) run(ctx context.Context, requestURL *url.URL, opts *regis ...@@ -216,9 +216,7 @@ func (b *blobDownload) run(ctx context.Context, requestURL *url.URL, opts *regis
return err return err
} }
defer file.Close() defer file.Close()
if err := setSparse(file); err != nil { setSparse(file)
return err
}
_ = file.Truncate(b.Total) _ = file.Truncate(b.Total)
......
...@@ -4,6 +4,5 @@ package server ...@@ -4,6 +4,5 @@ package server
import "os" import "os"
func setSparse(file *os.File) error { func setSparse(*os.File) {
return nil
} }
...@@ -6,8 +6,9 @@ import ( ...@@ -6,8 +6,9 @@ import (
"golang.org/x/sys/windows" "golang.org/x/sys/windows"
) )
func setSparse(file *os.File) error { func setSparse(file *os.File) {
return windows.DeviceIoControl( // exFat (and other FS types) don't support sparse files, so ignore errors
windows.DeviceIoControl( //nolint:errcheck
windows.Handle(file.Fd()), windows.FSCTL_SET_SPARSE, windows.Handle(file.Fd()), windows.FSCTL_SET_SPARSE,
nil, 0, nil, 0,
nil, 0, nil, 0,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment