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
Show 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
package
fuse
import
(
import
(
"bytes"
"fmt"
"fmt"
"log"
"log"
"os"
"os"
...
@@ -81,21 +82,15 @@ func unmount(mountPoint string) (err error) {
...
@@ -81,21 +82,15 @@ func unmount(mountPoint string) (err error) {
if
os
.
Geteuid
()
==
0
{
if
os
.
Geteuid
()
==
0
{
return
privilegedUnmount
(
mountPoint
)
return
privilegedUnmount
(
mountPoint
)
}
}
dir
,
_
:=
filepath
.
Split
(
mountPoint
)
errBuf
:=
bytes
.
Buffer
{}
proc
,
err
:=
os
.
StartProcess
(
fusermountBinary
,
cmd
:=
exec
.
Command
(
fusermountBinary
,
"-u"
,
mountPoint
)
[]
string
{
fusermountBinary
,
"-u"
,
mountPoint
},
cmd
.
Stderr
=
&
errBuf
&
os
.
ProcAttr
{
Dir
:
dir
,
Files
:
[]
*
os
.
File
{
nil
,
nil
,
os
.
Stderr
}})
err
=
cmd
.
Run
()
if
err
!=
nil
{
if
errBuf
.
Len
()
>
0
{
return
return
fmt
.
Errorf
(
"%s (code %v)
\n
"
,
errBuf
.
String
(),
err
)
}
}
w
,
err
:=
proc
.
Wait
()
return
err
if
err
!=
nil
{
return
}
if
!
w
.
Success
()
{
return
fmt
.
Errorf
(
"fusermount -u exited with code %v
\n
"
,
w
.
Sys
())
}
return
}
}
func
getConnection
(
local
*
os
.
File
)
(
int
,
error
)
{
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