# Mender-client 2.0 no longer exits 2 if nothing to commit

**URL:** <https://hub.mender.io/t/mender-client-2-0-no-longer-exits-2-if-nothing-to-commit/684>\
**Category:** General Discussions\
**Created:** [June 7, 2019, 5:08pm UTC](https://hub.mender.io/t/mender-client-2-0-no-longer-exits-2-if-nothing-to-commit/684 "2019-06-07T17:08:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cveilleux](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/cveilleux/32/307_2.png) [@cveilleux](https://hub.mender.io/u/cveilleux)\
**Post date:** [June 7, 2019, 5:08pm UTC](https://hub.mender.io/t/mender-client-2-0-no-longer-exits-2-if-nothing-to-commit/684/1 "2019-06-07T17:08:17Z")

</div>

In standalone mode, mender command exits with code 2 when running `mender -commit` when there is nothing to commit.

Under mender 2.0, the exit 2 is still there but the code block is unreachable.

Below is a quick and dirty patch to restore the behavior:

```auto
diff --git a/standalone.go b/standalone.go
index e54d1c6..6320cfb 100644
--- a/standalone.go
+++ b/standalone.go
@@ -538,7 +538,7 @@ func handlePreDatabaseRestore(device *deviceManager) (*standaloneData, error) {
 	// VerifyReboot() is what would be used to verify we have rebooted into
 	// a new update.
 	if !ok || dualRootfs.VerifyReboot() != nil {
- return nil, errors.New("No artifact installation in progress")
+ return nil, installer.ErrorNothingToCommit
 	}
 
 	// Forcibly sidestep the database for artifact name query and fetch it

```

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [June 11, 2019, 8:46am UTC](https://hub.mender.io/t/mender-client-2-0-no-longer-exits-2-if-nothing-to-commit/684/2 "2019-06-11T08:46:02Z")

</div>

Thanks, this indeed looks like a good fix. I have submitted it [https://github.com/mendersoftware/mender/pull/405](https://github.com/mendersoftware/mender/pull/405).
