From 96ef1e5edd40a6c1c2edbfc9068b26eb8dbecf65 Mon Sep 17 00:00:00 2001 From: pelya Date: Wed, 20 Jun 2012 18:09:38 +0300 Subject: [PATCH] Do not perform a check for broken libc, because it crashes sometimes, when libraries are not yet loaded in a separate thread --- project/java/Settings.java | 59 -------------------------------------- 1 file changed, 59 deletions(-) diff --git a/project/java/Settings.java b/project/java/Settings.java index 472f48998..35bc15c2d 100644 --- a/project/java/Settings.java +++ b/project/java/Settings.java @@ -426,65 +426,6 @@ class Settings public static void showConfig(final MainActivity p, final boolean firstStart) { settingsChanged = true; - if( !Globals.BrokenLibCMessageShown ) - { - Globals.BrokenLibCMessageShown = true; - try { - InputStream in = p.getAssets().open("stdout-test"); - File outDir = p.getFilesDir(); - try { - outDir.mkdirs(); - } catch( SecurityException ee ) { }; - - byte[] buf = new byte[16384]; - OutputStream out = null; - String path = outDir.getAbsolutePath() + "/" + "stdout-test"; - - out = new FileOutputStream( path ); - int len = in.read(buf); - while (len >= 0) - { - if(len > 0) - out.write(buf, 0, len); - len = in.read(buf); - } - - out.flush(); - out.close(); - Settings.nativeChmod(path, 0755); - if( (new ProcessBuilder().command(path).start()).waitFor() != 42 ) - { - System.out.println("libSDL: stdout-test FAILED, your libc is broken"); - AlertDialog.Builder builder = new AlertDialog.Builder(p); - builder.setTitle(p.getResources().getString(R.string.broken_libc_title)); - builder.setMessage(p.getResources().getString(R.string.broken_libc_text)); - builder.setPositiveButton(p.getResources().getString(R.string.ok), new DialogInterface.OnClickListener() - { - public void onClick(DialogInterface dialog, int item) - { - dialog.dismiss(); - showConfig(p, firstStart); - } - }); - builder.setOnCancelListener(new DialogInterface.OnCancelListener() - { - public void onCancel(DialogInterface dialog) - { - dialog.dismiss(); - showConfig(p, firstStart); - } - }); - AlertDialog alert = builder.create(); - alert.setOwnerActivity(p); - alert.show(); - return; - } - System.out.println("libSDL: stdout-test passed, your libc seems to be good"); - } catch ( Exception eeee ) { - System.out.println("libSDL: Cannot run stdout-test: " + eeee.toString()); - } - } - if( Globals.OptionalDataDownload == null ) { String downloads[] = Globals.DataDownloadUrl.split("\\^");