Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ] device: Fix cache update on device remove
@ 2026-06-08 12:27 Frédéric Danis
  2026-06-08 15:41 ` [BlueZ] " bluez.test.bot
  2026-06-08 18:20 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Frédéric Danis @ 2026-06-08 12:27 UTC (permalink / raw)
  To: linux-bluetooth

If there's no other group than the one explicitly removed the length
returned by g_key_file_to_data() will be 0 and currently nothing
will be changed in the device cache file.

If there's nothing to write, remove the device cache file.
---
 src/device.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/device.c b/src/device.c
index bea893301..046c8017e 100644
--- a/src/device.c
+++ b/src/device.c
@@ -5469,6 +5469,8 @@ static void device_remove_stored(struct btd_device *device)
 								gerr->message);
 			g_error_free(gerr);
 		}
+	} else {
+		unlink(filename);
 	}
 
 	g_free(data);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-08 18:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-08 12:27 [PATCH BlueZ] device: Fix cache update on device remove Frédéric Danis
2026-06-08 15:41 ` [BlueZ] " bluez.test.bot
2026-06-08 18:20 ` [PATCH BlueZ] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox