Delete old pid file (#2816)

This commit is contained in:
南宫雪珊 2023-10-14 13:57:46 +08:00 committed by GitHub
parent 50004a55cb
commit 5814ceb24b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -272,7 +272,12 @@ public class HomeFragment extends BaseFragment implements MenuProvider {
Os.kill(pid, 0);
developer.set(true);
} catch (ErrnoException e) {
if (e.errno != OsConstants.ESRCH) {
if (e.errno == OsConstants.ESRCH) {
try {
Files.delete(name);
} catch (IOException ignored) {
}
} else {
developer.set(true);
}
}