Add Donut rpc service for sending changes to configuration files

This commit is contained in:
Harshavardhana
2015-07-06 10:35:23 -07:00
parent 57d634da25
commit 1d64e4b6c1
7 changed files with 67 additions and 13 deletions

View File

@@ -34,6 +34,7 @@ func getDonutConfigPath() (string, error) {
return donutConfigPath, nil
}
// NOTE - this is not to be used outside Donut package, this is primarily intended for testing purposes only
var customConfigPath string
// SaveConfig save donut config

View File

@@ -38,11 +38,6 @@ func New(diskPath string) (Disk, error) {
if diskPath == "" {
return Disk{}, iodine.New(InvalidArgument{}, nil)
}
s := syscall.Statfs_t{}
err := syscall.Statfs(diskPath, &s)
if err != nil {
return Disk{}, iodine.New(err, nil)
}
st, err := os.Stat(diskPath)
if err != nil {
return Disk{}, iodine.New(err, nil)
@@ -50,6 +45,11 @@ func New(diskPath string) (Disk, error) {
if !st.IsDir() {
return Disk{}, iodine.New(syscall.ENOTDIR, nil)
}
s := syscall.Statfs_t{}
err = syscall.Statfs(diskPath, &s)
if err != nil {
return Disk{}, iodine.New(err, nil)
}
disk := Disk{
path: diskPath,
fsInfo: make(map[string]string),