Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
41b7f6d3
Commit
41b7f6d3
authored
Jun 18, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1391 from ipfs/fix-fuse-err
fix fuse mount error in linux
parents
b46712bd
bc85a638
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
core/commands/mount_unix.go
core/commands/mount_unix.go
+10
-3
No files found.
core/commands/mount_unix.go
View file @
41b7f6d3
...
...
@@ -24,6 +24,9 @@ const mountTimeout = time.Second
// fuseNoDirectory used to check the returning fuse error
const
fuseNoDirectory
=
"fusermount: failed to access mountpoint"
// fuseExitStatus1 used to check the returning fuse error
const
fuseExitStatus1
=
"fusermount: exit status 1"
// platformFuseChecks can get overridden by arch-specific files
// to run fuse checks (like checking the OSXFUSE version)
var
platformFuseChecks
=
func
(
*
core
.
IpfsNode
)
error
{
...
...
@@ -181,13 +184,17 @@ func Mount(node *core.IpfsNode, fsdir, nsdir string) error {
}
func
doMount
(
node
*
core
.
IpfsNode
,
fsdir
,
nsdir
string
)
error
{
fmtFuseErr
:=
func
(
err
error
)
error
{
fmtFuseErr
:=
func
(
err
error
,
mountpoint
string
)
error
{
s
:=
err
.
Error
()
if
strings
.
Contains
(
s
,
fuseNoDirectory
)
{
s
=
strings
.
Replace
(
s
,
`fusermount: "fusermount:`
,
""
,
-
1
)
s
=
strings
.
Replace
(
s
,
`\n", exit status 1`
,
""
,
-
1
)
return
cmds
.
ClientError
(
s
)
}
if
s
==
fuseExitStatus1
{
s
=
fmt
.
Sprintf
(
"fuse failed to access mountpoint %s"
,
mountpoint
)
return
cmds
.
ClientError
(
s
)
}
return
err
}
...
...
@@ -222,9 +229,9 @@ func doMount(node *core.IpfsNode, fsdir, nsdir string) error {
}
if
err1
!=
nil
{
return
fmtFuseErr
(
err1
)
return
fmtFuseErr
(
err1
,
fsdir
)
}
return
fmtFuseErr
(
err2
)
return
fmtFuseErr
(
err2
,
nsdir
)
}
// setup node state, so that it can be cancelled
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment