Skip to content

Commit

Permalink
Ignore general IOException when attempting to read cmdline
Browse files Browse the repository at this point in the history
  • Loading branch information
Mygod committed Mar 8, 2019
1 parent 28e03c7 commit 0d3b45c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/com/github/shadowsocks/bg/Executable.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import android.text.TextUtils
import android.util.Log
import com.crashlytics.android.Crashlytics
import java.io.File
import java.io.FileNotFoundException
import java.io.IOException

object Executable {
const val REDSOCKS = "libredsocks.so"
Expand All @@ -40,7 +40,7 @@ object Executable {
for (process in File("/proc").listFiles { _, name -> TextUtils.isDigitsOnly(name) }) {
val exe = File(try {
File(process, "cmdline").inputStream().bufferedReader().readText()
} catch (_: FileNotFoundException) {
} catch (_: IOException) {
continue
}.split(Character.MIN_VALUE, limit = 2).first())
if (EXECUTABLES.contains(exe.name)) try {
Expand Down

0 comments on commit 0d3b45c

Please sign in to comment.