mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-12-27 05:11:30 +00:00
Improved handling of Syncthing exit codes
This commit is contained in:
parent
3e4effa7c6
commit
5153502e4a
1 changed files with 3 additions and 8 deletions
|
@ -151,20 +151,15 @@ public class SyncthingRunnable implements Runnable {
|
|||
|
||||
switch (ret) {
|
||||
case 0:
|
||||
case 4:
|
||||
// Valid exit codes, ignored.
|
||||
case 137:
|
||||
// Syncthing was shut down (via API or SIGKILL), do nothing.
|
||||
break;
|
||||
case 3:
|
||||
// Restart if that was requested via Rest API call.
|
||||
// Restart was requested via Rest API call.
|
||||
Log.i(TAG, "Restarting syncthing");
|
||||
mContext.startService(new Intent(mContext, SyncthingService.class)
|
||||
.setAction(SyncthingService.ACTION_RESTART));
|
||||
break;
|
||||
case 137:
|
||||
// Ignore SIGKILL that we use to stop Syncthing.
|
||||
break;
|
||||
case 1:
|
||||
// fallthrough
|
||||
default:
|
||||
// Report Syncthing crashes, using Exception in debug mode or log in release mode.
|
||||
String message = "Syncthing binary crashed with error code " +
|
||||
|
|
Loading…
Reference in a new issue