Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Levin Zimmermann
go-fuse
Commits
eb61a86c
Commit
eb61a86c
authored
Mar 24, 2013
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fuse: capture fusermount stderr in error return.
parent
76e5775e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
14 deletions
+9
-14
fuse/mount_linux.go
fuse/mount_linux.go
+9
-14
No files found.
fuse/mount_linux.go
View file @
eb61a86c
package
fuse
import
(
"bytes"
"fmt"
"log"
"os"
...
...
@@ -81,21 +82,15 @@ func unmount(mountPoint string) (err error) {
if
os
.
Geteuid
()
==
0
{
return
privilegedUnmount
(
mountPoint
)
}
dir
,
_
:=
filepath
.
Split
(
mountPoint
)
proc
,
err
:=
os
.
StartProcess
(
fusermountBinary
,
[]
string
{
fusermountBinary
,
"-u"
,
mountPoint
},
&
os
.
ProcAttr
{
Dir
:
dir
,
Files
:
[]
*
os
.
File
{
nil
,
nil
,
os
.
Stderr
}})
if
err
!=
nil
{
return
errBuf
:=
bytes
.
Buffer
{}
cmd
:=
exec
.
Command
(
fusermountBinary
,
"-u"
,
mountPoint
)
cmd
.
Stderr
=
&
errBuf
err
=
cmd
.
Run
()
if
errBuf
.
Len
()
>
0
{
return
fmt
.
Errorf
(
"%s (code %v)
\n
"
,
errBuf
.
String
(),
err
)
}
w
,
err
:=
proc
.
Wait
()
if
err
!=
nil
{
return
}
if
!
w
.
Success
()
{
return
fmt
.
Errorf
(
"fusermount -u exited with code %v
\n
"
,
w
.
Sys
())
}
return
return
err
}
func
getConnection
(
local
*
os
.
File
)
(
int
,
error
)
{
...
...
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