summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2015-03-13 08:35:59 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-03-23 00:01:46 -0400
commit9ad7334d68fe2187968c4716097a24575835ab04 (patch)
tree3e253b8348a41e524b125953df87f85fe3d4f196
parent9270c8ffa5a7f12f510772eba0eb40fbb16ad163 (diff)
core: don't change removed devices to state "tentative"
Commit 628c89c introduced the "tentative" device state, which caused devices to go from "plugged" to "tentative" on a remove uevent. This breaks the cleanup of stale mounts (see commit 3b48ce4), as that only applies to "dead" devices. The "tentative" state only really makes sense on adding a device when we don't know where it was coming from (i. e. not from udev). But when we get a device removal from udev we definitively know that it's gone, so change the device state back to "dead" as before 628c89c. (cherry picked from commit 496068a8288084ab3ecf8b179a8403ecff1a6be8)
-rw-r--r--src/core/device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/device.c b/src/core/device.c
index 4ff882721..cc4ebd2c8 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -421,7 +421,7 @@ static void device_update_found_one(Device *d, bool add, DeviceFound found, bool
if (now) {
if (d->found & DEVICE_FOUND_UDEV)
device_set_state(d, DEVICE_PLUGGED);
- else if (d->found != DEVICE_NOT_FOUND)
+ else if (add && d->found != DEVICE_NOT_FOUND)
device_set_state(d, DEVICE_TENTATIVE);
else
device_set_state(d, DEVICE_DEAD);