1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-12-02 01:01:17 +00:00

Improved handling of Syncthing exit codes

This commit is contained in:
Felix Ableitner 2016-12-28 13:24:25 +09:00
parent 3e4effa7c6
commit 5153502e4a

View file

@ -151,20 +151,15 @@ public class SyncthingRunnable implements Runnable {
switch (ret) { switch (ret) {
case 0: case 0:
case 4: case 137:
// Valid exit codes, ignored. // Syncthing was shut down (via API or SIGKILL), do nothing.
break; break;
case 3: case 3:
// Restart if that was requested via Rest API call. // Restart was requested via Rest API call.
Log.i(TAG, "Restarting syncthing"); Log.i(TAG, "Restarting syncthing");
mContext.startService(new Intent(mContext, SyncthingService.class) mContext.startService(new Intent(mContext, SyncthingService.class)
.setAction(SyncthingService.ACTION_RESTART)); .setAction(SyncthingService.ACTION_RESTART));
break; break;
case 137:
// Ignore SIGKILL that we use to stop Syncthing.
break;
case 1:
// fallthrough
default: default:
// Report Syncthing crashes, using Exception in debug mode or log in release mode. // Report Syncthing crashes, using Exception in debug mode or log in release mode.
String message = "Syncthing binary crashed with error code " + String message = "Syncthing binary crashed with error code " +