Better error code for unmounting not-mounted volumes
ENOENT is more descriptive than the generic error that EINVAL gets
turned into. Then we can actually treat it how we want on the other
side.
Change-Id: I9b4f3be6308e13f680eae368d2167ab9ee6aae5f
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index 899dc23..3b229b7 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -559,7 +559,7 @@
const char *fileName, const char *mountPoint, bool force) {
if (!isMountpointMounted(mountPoint)) {
SLOGE("Unmount request for %s when not mounted", id);
- errno = EINVAL;
+ errno = ENOENT;
return -1;
}