Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit() ignores errors #4

Closed
LongHairedHacker opened this issue Jul 18, 2019 · 1 comment
Closed

Commit() ignores errors #4

LongHairedHacker opened this issue Jul 18, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@LongHairedHacker
Copy link
Contributor

LongHairedHacker commented Jul 18, 2019

Seems like I found another bug.
I've just noticed that in case of an error writing to the config file (e.g. permission problem, out of disk space ...) Commit() still returns nil.

go-uci/uci.go

Lines 110 to 121 in a970c4b

func (t *tree) Commit() error {
t.Lock()
defer t.Unlock()
for _, config := range t.configs {
if !config.tainted {
continue
}
t.saveConfig(config)
}
return nil
}

It ignores any errors returned by t.saveConfig(config).

I'll have a pull request ready in a few moments.

@dmke
Copy link
Member

dmke commented Jul 18, 2019

Fixed with #5. Thank you!

@dmke dmke closed this as completed Jul 18, 2019
@dmke dmke added the bug Something isn't working label Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants