Commit 22bcd9f4 authored by spiiroin's avatar spiiroin

[udev] Do not exit if cable state can't be determined

If usb-moded exits when it can't deduce cable connect state, it will
be restarted by systemd. As the usb-moded restarts are not going to
change how the udev status looks like, this repeats until systemd
moves the usb-moded service to failed state.

Do not exit and assume no usb-cable is connected. In addition to not
triggering restart spree, this has the additional benefit that the
usb-moded dbus interface stays available and signaling not-connected
state.
Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
parent 0d5a10b7
......@@ -405,14 +405,7 @@ static void udev_parse(struct udev_device *dev, bool initial)
power_supply_online = udev_device_get_property_value(dev, "POWER_SUPPLY_ONLINE");
}
if (!power_supply_present) {
log_err("No usable power supply indicator\n");
/* TRY AGAIN?
return; */
exit(1);
}
if (!strcmp(power_supply_present, "1"))
if (power_supply_present && !strcmp(power_supply_present, "1"))
connected = true;
/* Transition period = Connection status derived from udev
......@@ -426,6 +419,9 @@ static void udev_parse(struct udev_device *dev, bool initial)
/* disconnect */
if (!connected) {
if (warnings && !power_supply_present)
log_err("No usable power supply indicator\n");
log_debug("DISCONNECTED");
cancel_cable_connection_timeout();
......
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