|
@@ -49,18 +49,19 @@ func mountFrom(dir, device, target, mType string, flags uintptr, label string) e
|
|
output := bytes.NewBuffer(nil)
|
|
output := bytes.NewBuffer(nil)
|
|
cmd.Stdout = output
|
|
cmd.Stdout = output
|
|
cmd.Stderr = output
|
|
cmd.Stderr = output
|
|
-
|
|
|
|
if err := cmd.Start(); err != nil {
|
|
if err := cmd.Start(); err != nil {
|
|
|
|
+ w.Close()
|
|
return fmt.Errorf("mountfrom error on re-exec cmd: %v", err)
|
|
return fmt.Errorf("mountfrom error on re-exec cmd: %v", err)
|
|
}
|
|
}
|
|
//write the options to the pipe for the untar exec to read
|
|
//write the options to the pipe for the untar exec to read
|
|
if err := json.NewEncoder(w).Encode(options); err != nil {
|
|
if err := json.NewEncoder(w).Encode(options); err != nil {
|
|
|
|
+ w.Close()
|
|
return fmt.Errorf("mountfrom json encode to pipe failed: %v", err)
|
|
return fmt.Errorf("mountfrom json encode to pipe failed: %v", err)
|
|
}
|
|
}
|
|
w.Close()
|
|
w.Close()
|
|
|
|
|
|
if err := cmd.Wait(); err != nil {
|
|
if err := cmd.Wait(); err != nil {
|
|
- return fmt.Errorf("mountfrom re-exec error: %v: output: %s", err, output)
|
|
|
|
|
|
+ return fmt.Errorf("mountfrom re-exec error: %v: output: %v", err, output)
|
|
}
|
|
}
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|