48 lines
1.8 KiB
Diff
48 lines
1.8 KiB
Diff
From f5a75f2027e53bdaf4deb7087fac73f8be6bf4f4 Mon Sep 17 00:00:00 2001
|
|
From: Yu Watanabe <watanabe.yu+github@gmail.com>
|
|
Date: Sun, 17 Apr 2022 13:11:08 +0900
|
|
Subject: [PATCH] sd-device: reduce indentation
|
|
|
|
Conflict:NA
|
|
Reference:https://github.com/systemd/systemd/commit/f5a75f2027e53bdaf4deb7087fac73f8be6bf4f4
|
|
|
|
---
|
|
src/libsystemd/sd-device/device-private.c | 18 ++++++++----------
|
|
1 file changed, 8 insertions(+), 10 deletions(-)
|
|
|
|
diff --git a/src/libsystemd/sd-device/device-private.c b/src/libsystemd/sd-device/device-private.c
|
|
index 90dcd3a857..9bf39ecfab 100644
|
|
--- a/src/libsystemd/sd-device/device-private.c
|
|
+++ b/src/libsystemd/sd-device/device-private.c
|
|
@@ -774,19 +774,17 @@ int device_rename(sd_device *device, const char *name) {
|
|
return r;
|
|
|
|
r = sd_device_get_property_value(device, "INTERFACE", &interface);
|
|
- if (r >= 0) {
|
|
- /* like DEVPATH_OLD, INTERFACE_OLD is not saved to the db, but only stays around for the current event */
|
|
- r = device_add_property_internal(device, "INTERFACE_OLD", interface);
|
|
- if (r < 0)
|
|
- return r;
|
|
+ if (r == -ENOENT)
|
|
+ return 0;
|
|
+ if (r < 0)
|
|
+ return r;
|
|
|
|
- r = device_add_property_internal(device, "INTERFACE", name);
|
|
- if (r < 0)
|
|
- return r;
|
|
- } else if (r != -ENOENT)
|
|
+ /* like DEVPATH_OLD, INTERFACE_OLD is not saved to the db, but only stays around for the current event */
|
|
+ r = device_add_property_internal(device, "INTERFACE_OLD", interface);
|
|
+ if (r < 0)
|
|
return r;
|
|
|
|
- return 0;
|
|
+ return device_add_property_internal(device, "INTERFACE", name);
|
|
}
|
|
|
|
int device_shallow_clone(sd_device *old_device, sd_device **new_device) {
|
|
--
|
|
2.39.1
|
|
|