Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-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
Kirill Smelkov
jacobsa-fuse
Commits
39dfb0c8
Commit
39dfb0c8
authored
Mar 24, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't hide command termination errors behind unmount errors.
parent
dff6fe8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
7 deletions
+21
-7
samples/subprocess.go
samples/subprocess.go
+21
-7
No files found.
samples/subprocess.go
View file @
39dfb0c8
...
...
@@ -18,6 +18,7 @@ import (
"fmt"
"io"
"io/ioutil"
"log"
"os/exec"
"path"
"sync"
...
...
@@ -173,17 +174,30 @@ func (t *SubprocessTest) destroy() (err error) {
ogletest
.
ExpectEq
(
nil
,
c
.
Close
())
}
//
Was the file system mounted?
//
If we didn't try to mount the file system, there's nothing further to do.
if
t
.
mountCmd
==
nil
{
return
}
// Unmount the file system.
err
=
unmount
(
t
.
Dir
)
if
err
!=
nil
{
err
=
fmt
.
Errorf
(
"unmount: %v"
,
err
)
return
}
// In the background, initiate an unmount.
unmountErrChan
:=
make
(
chan
error
)
go
func
()
{
unmountErrChan
<-
unmount
(
t
.
Dir
)
}()
// Make sure we wait for the unmount, even if we've already returned early in
// error. Return its error if we haven't seen any other error.
defer
func
()
{
unmountErr
:=
<-
unmountErrChan
if
unmountErr
!=
nil
{
if
err
!=
nil
{
log
.
Println
(
"unmount:"
,
unmountErr
)
return
}
err
=
fmt
.
Errorf
(
"unmount: %v"
,
unmountErr
)
}
}()
// Wait for the subprocess.
if
err
=
t
.
mountCmd
.
Wait
();
err
!=
nil
{
...
...
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