diff options
author | Bogdan Gheorghe <gheorghe> | 2009-06-01 20:56:11 +0000 |
---|---|---|
committer | Bogdan Gheorghe <gheorghe> | 2009-06-01 20:56:11 +0000 |
commit | d9da699dd998b31d2ab0832e08f8aa80a8cbc819 (patch) | |
tree | 09800aafd835386fd58a4339e1cfa746d385c6be | |
parent | 74138e450544338f7b1205f3bba6bd077f6cd699 (diff) | |
download | eclipse.platform.swt-d9da699dd998b31d2ab0832e08f8aa80a8cbc819.tar.gz eclipse.platform.swt-d9da699dd998b31d2ab0832e08f8aa80a8cbc819.tar.xz eclipse.platform.swt-d9da699dd998b31d2ab0832e08f8aa80a8cbc819.zip |
278413 [regression] created swt-32 and swt-64 directories must be writable by anyonev3549b
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java b/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java index 7fc6bc2ab1..79024457be 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java @@ -41,8 +41,8 @@ public class Library { /* 64-bit support */ static /*final*/ boolean IS_64 = 0x1FFFFFFFFL == (int /*long*/)0x1FFFFFFFFL; static final String SUFFIX_64 = "-64"; //$NON-NLS-1$ - static final String SWTDIR_32 = "swt-32"; //$NON-NLS-1$ - static final String SWTDIR_64 = "swt-64"; //$NON-NLS-1$ + static final String SWTDIR_32 = "swtlib-32"; //$NON-NLS-1$ + static final String SWTDIR_64 = "swtlib-64"; //$NON-NLS-1$ static { SEPARATOR = System.getProperty("file.separator"); @@ -225,8 +225,14 @@ public static void loadLibrary (String name, boolean mapName) { if (path == null) { path = System.getProperty ("java.io.tmpdir"); //$NON-NLS-1$ File dir = new File (path, IS_64 ? SWTDIR_64 : SWTDIR_32); - if ((dir.exists () && dir.isDirectory ()) || dir.mkdir ()) { + boolean make = false; + if ((dir.exists () && dir.isDirectory ()) || (make = dir.mkdir ())) { path = dir.getAbsolutePath (); + if (make && !Platform.PLATFORM.equals ("win32")) { //$NON-NLS-1$ + try { + Runtime.getRuntime ().exec (new String []{"chmod", "777", path}).waitFor(); //$NON-NLS-1$ //$NON-NLS-2$ + } catch (Throwable e) {} + } } else { /* fall back to using the tmp directory */ if (IS_64) { |