Commit 9d421b23 authored by Sebastian Stark's avatar Sebastian Stark

fix check for rsync exit code

  - WaitStatus has an ExitStatus() method we need to use to get the
    return code as an integer value
parent b777a65d
......@@ -98,9 +98,9 @@ func CreateSnapshot(base *Snapshot) (*Snapshot, error) {
// First, get the error code
if exiterr, ok := err.(*exec.ExitError); ok { // The return code != 0)
if status, ok := exiterr.Sys().(syscall.WaitStatus); ok { // Finally get the actual status code
Debugf("The error code we got is: ", err)
Debugf("The error code we got is: ", status.ExitStatus())
// status now holds the actual return code
if status == 24 { // Magic number: means some files couldn't be copied because they vanished, so nothing critical. See man rsync
if status.ExitStatus() == 24 { // Magic number: means some files couldn't be copied because they vanished, so nothing critical. See man rsync
Debugf("Some files failed to copy because they were deleted in the meantime, but nothing critical... going on...")
failed = false
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment