提交 46923142 编写于 作者: S Sergio Lopez 提交者: Derek Parker

pkg/config: Rewind *File after writeDefaultConfig

Otherwise the later call to ioutil.ReadAll will return an empty array.

This issue is visible from the user's perspective due to the new
debug-info-directories parameter, which does have a value in the default
config.

As a consequence, the first 'dlv' invocation fails to find the separate
debug info files, while the second one works as expected:

$ ./dlv core /usr/bin/dockerd-current /case/dockerd.1234
could not find external debug info file
$ ./dlv core /usr/bin/dockerd-current /case/dockerd.1234
Type 'help' for list of commands.
(dlv) exit
上级 85e4ba43
......@@ -2,6 +2,7 @@ package config
import (
"fmt"
"io"
"io/ioutil"
"os"
"os/user"
......@@ -129,6 +130,7 @@ func createDefaultConfig(path string) (*os.File, error) {
if err != nil {
return nil, fmt.Errorf("unable to write default configuration: %v", err)
}
f.Seek(0, io.SeekStart)
return f, nil
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册