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

Commit

Permalink
Merge pull request #419 from nak3/flex-mkdir
Browse files Browse the repository at this point in the history
flex: tiny: catch error when failed to create directory
  • Loading branch information
xiang90 authored Dec 13, 2016
2 parents 07ddb8d + 29b9327 commit b783b16
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/torusblk/flex.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
onErr(err)
}

ex := exec.Command("mount", "-t", vol.FSType, "-o", flags, mountdev, mountdir)
_, err = ex.CombinedOutput()
if err != nil {
Expand Down

0 comments on commit b783b16

Please sign in to comment.