Skip to content
This repository has been archived by the owner on Sep 22, 2020. It is now read-only.

flex: tiny: catch error when failed to create directory #419

Merged
merged 1 commit into from
Dec 13, 2016
Merged

flex: tiny: catch error when failed to create directory #419

merged 1 commit into from
Dec 13, 2016

Conversation

nak3
Copy link
Contributor

@nak3 nak3 commented Dec 4, 2016

No description provided.

@@ -285,7 +285,10 @@ func mountAction(cmd *cobra.Command, args []string) {
// Device: mountdev,
// })
// }
os.MkdirAll(mountdir, os.ModeDir|0555)
if err := os.MkdirAll(mountdir, os.ModeDir|0555); err != nil && !os.IsExist(err) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

err cannot be os.exist. see https://golang.org/pkg/os/#MkdirAll.

remove the !os.IsExist part, then lgtm. Thanks.

@nak3
Copy link
Contributor Author

nak3 commented Dec 13, 2016

Thank you. You are right. I updated it.

@xiang90
Copy link
Contributor

xiang90 commented Dec 13, 2016

lgtm

@xiang90 xiang90 merged commit b783b16 into coreos:master Dec 13, 2016
@nak3 nak3 deleted the flex-mkdir branch December 15, 2016 08:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants