Intergrated syncthing (#1442)

This commit is contained in:
superboo07 authored and GitHub committed 2026-11-01 12:58:09 -05:00
1 parent 5b7e401b11
commit 8c09b2c6a8
34 files changed
+2492 -7

No files matched your search

@@ -11,7 +11,7 @@ object OrphanReaper {
fun release(pid: Int) { kept.remove(pid) }
fun reap(reason: String): Int {
fun reap(reason: String, matching: (String) -> Boolean = { true }): Int {
val me = android.os.Process.myPid()
val uid = android.os.Process.myUid()
val spared = descendants(kept)
@@ -21,6 +21,7 @@ object OrphanReaper {
if (pid == me || pid <= 1 || pid in spared) return@forEach
if (uidOf(pid) != uid) return@forEach
val name = try { File(entry, "cmdline").readText().substringBefore('\u0000') } catch (e: Exception) { "?" }
if (!matching(name)) return@forEach
try {
android.os.Process.killProcess(pid)
killed++