| Index: mmutex/cmd/mmutex/exclusive.go
|
| diff --git a/mmutex/cmd/mmutex/exclusive.go b/mmutex/cmd/mmutex/exclusive.go
|
| index 00ff24d6e694ec1206be158578886e8c09df413e..dd799fb2d8f28516594de0bf15b32fe102e0bdc3 100644
|
| --- a/mmutex/cmd/mmutex/exclusive.go
|
| +++ b/mmutex/cmd/mmutex/exclusive.go
|
| @@ -27,12 +27,12 @@ import (
|
| )
|
|
|
| var cmdExclusive = &subcommands.Command{
|
| - UsageLine: "exclusive -- <command>",
|
| + UsageLine: "exclusive [options] -- <command>",
|
| ShortDesc: "acquires an exclusive lock before running the command",
|
| CommandRun: func() subcommands.CommandRun {
|
| c := &cmdExclusiveRun{}
|
| - c.Flags.DurationVar(&c.fslockTimeout, "fslock-timeout", 0, "Lock acquisition timeout")
|
| - c.Flags.DurationVar(&c.fslockPollingInterval, "fslock-polling-interval", 0, "Lock acquisition polling interval")
|
| + c.Flags.DurationVar(&c.fslockTimeout, "fslock-timeout", 2*time.Hour, "Lock acquisition timeout")
|
| + c.Flags.DurationVar(&c.fslockPollingInterval, "fslock-polling-interval", 5*time.Second, "Lock acquisition polling interval")
|
| return c
|
| },
|
| }
|
| @@ -45,6 +45,11 @@ type cmdExclusiveRun struct {
|
|
|
| func (c *cmdExclusiveRun) Run(a subcommands.Application, args []string, env subcommands.Env) int {
|
| if err := RunExclusive(args, c.fslockTimeout, c.fslockPollingInterval); err != nil {
|
| + if exitErr, ok := err.(*exec.ExitError); ok {
|
| + return lib.GetExitCode(exitErr)
|
| + }
|
| +
|
| + // We encountered an error that's unrelated to the command itself.
|
| fmt.Fprintln(os.Stderr, err)
|
| return 1
|
| } else {
|
|
|