From 78398a9eef82d4355b85daf14294980ba4cb44ad Mon Sep 17 00:00:00 2001 From: Mygod Date: Fri, 16 Apr 2021 15:36:49 -0400 Subject: [PATCH] Reduce process premature death warnings --- mobile/src/main/java/be/mygod/librootkotlinx/RootServer.kt | 3 ++- .../src/main/java/be/mygod/vpnhotspot/net/monitor/IpMonitor.kt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mobile/src/main/java/be/mygod/librootkotlinx/RootServer.kt b/mobile/src/main/java/be/mygod/librootkotlinx/RootServer.kt index b171baeb..ad98b2b2 100644 --- a/mobile/src/main/java/be/mygod/librootkotlinx/RootServer.kt +++ b/mobile/src/main/java/be/mygod/librootkotlinx/RootServer.kt @@ -303,7 +303,8 @@ class RootServer { output.close() process.outputStream.close() } catch (e: IOException) { - Logger.me.i("send Shutdown failed", e) + // Stream closed caused in NullOutputStream + if (e.message != "Stream closed") Logger.me.w("send Shutdown failed", e) } Logger.me.d("Client closed") } diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/IpMonitor.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/IpMonitor.kt index 3fc6f26a..ad4c0394 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/IpMonitor.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/monitor/IpMonitor.kt @@ -81,7 +81,7 @@ abstract class IpMonitor { } else processLine(it) } } catch (_: InterruptedIOException) { } catch (e: IOException) { - if ((e.cause as? ErrnoException)?.errno != OsConstants.EBADF) Timber.w(e) + if ((e.cause as? ErrnoException)?.errno != OsConstants.EBADF && e.message != "Stream closed") Timber.w(e) } err.join() Timber.d("Monitor process exited with ${process.waitFor()}")