Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 185465 Details for
Bug 286162
Debug core logs spawner IO exception when running C/C++ executable on Linux
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Spawner to upse PTY streams and ignore error on close, plus dummy mode for stderr.
20101217_286162.patch (text/plain), 4.42 KB, created by
Pawel Piech
on 2010-12-17 17:21:26 EST
(
hide
)
Description:
Spawner to upse PTY streams and ignore error on close, plus dummy mode for stderr.
Filename:
MIME Type:
Creator:
Pawel Piech
Created:
2010-12-17 17:21:26 EST
Size:
4.42 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.core >Index: utils/org/eclipse/cdt/utils/pty/PTYInputStream.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/pty/PTYInputStream.java,v >retrieving revision 1.13 >diff -u -r1.13 PTYInputStream.java >--- utils/org/eclipse/cdt/utils/pty/PTYInputStream.java 3 Jun 2010 17:36:01 -0000 1.13 >+++ utils/org/eclipse/cdt/utils/pty/PTYInputStream.java 17 Dec 2010 22:18:06 -0000 >@@ -14,7 +14,6 @@ > import java.io.IOException; > import java.io.InputStream; > >-import org.eclipse.cdt.core.CCorePlugin; > import org.eclipse.cdt.utils.pty.PTY.MasterFD; > > class PTYInputStream extends InputStream { >@@ -74,9 +73,10 @@ > public void close() throws IOException { > if (master.getFD() == -1) > return; >- int status = close0(master.getFD()); >- if (status == -1) >- throw new IOException(CCorePlugin.getResourceString("Util.exception.closeError")); //$NON-NLS-1$ >+ close0(master.getFD()); >+ // ignore error on close - see bug 286162 >+// if (status == -1) >+// throw new IOException(CCorePlugin.getResourceString("Util.exception.closeError")); //$NON-NLS-1$ > master.setFD(-1); > } > >Index: utils/org/eclipse/cdt/utils/spawner/Spawner.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/Spawner.java,v >retrieving revision 1.21 >diff -u -r1.21 Spawner.java >--- utils/org/eclipse/cdt/utils/spawner/Spawner.java 30 Apr 2010 21:06:54 -0000 1.21 >+++ utils/org/eclipse/cdt/utils/spawner/Spawner.java 17 Dec 2010 22:18:06 -0000 >@@ -66,6 +66,7 @@ > OutputStream out; > InputStream in; > InputStream err; >+ private PTY fPty; > > public Spawner(String command, boolean bNoRedirect) throws IOException { > StringTokenizer tokenizer = new StringTokenizer(command); >@@ -92,6 +93,7 @@ > String dirpath = "."; //$NON-NLS-1$ > if (dir != null) > dirpath = dir.getAbsolutePath(); >+ fPty = pty; > exec_pty(cmdarray, envp, dirpath, pty); > } > /** >@@ -144,8 +146,13 @@ > **/ > @Override > public InputStream getInputStream() { >- if(null == in) >- in = new SpawnerInputStream(fChannels[1]); >+ if(null == in) { >+ if (fPty != null) { >+ in = fPty.getInputStream(); >+ } else { >+ in = new SpawnerInputStream(fChannels[1]); >+ } >+ } > return in; > } > >@@ -154,8 +161,13 @@ > **/ > @Override > public OutputStream getOutputStream() { >- if(null == out) >- out = new SpawnerOutputStream(fChannels[0]); >+ if(null == out) { >+ if (fPty != null) { >+ out = fPty.getOutputStream(); >+ } else { >+ out = new SpawnerOutputStream(fChannels[0]); >+ } >+ } > return out; > } > >@@ -165,7 +177,34 @@ > @Override > public InputStream getErrorStream() { > if(null == err) >- err = new SpawnerInputStream(fChannels[2]); >+ if (fPty != null && !fPty.isConsole()) { >+ // If PTY is used and it's not in "Console" mode, then stderr is >+ // redirected to the PTY's output stream. Therefore, return a >+ // dummy stream for error stream. >+ err = new InputStream() { >+ boolean fClosed = false; >+ @Override >+ public synchronized int read() throws IOException { >+ while (!fClosed) { >+ try { >+ wait(); >+ } catch (InterruptedException e) {} >+ } >+ return -1; >+ } >+ >+ @Override >+ public void close() throws IOException { >+ synchronized(this) { >+ fClosed = true; >+ notifyAll(); >+ } >+ super.close(); >+ } >+ }; >+ } else { >+ err = new SpawnerInputStream(fChannels[2]); >+ } > return err; > } > >@@ -179,12 +218,11 @@ > } > try { > if(null == err) >- ((SpawnerInputStream)getErrorStream()).close(); >+ getErrorStream().close(); > if(null == in) >- ((SpawnerInputStream)getInputStream()).close(); >+ getInputStream().close(); > if(null == out) >- ((SpawnerOutputStream)getOutputStream()).close(); >- >+ getOutputStream().close(); > } catch (IOException e) { > } > return status; >@@ -211,11 +249,11 @@ > // Close the streams on this side. > try { > if(null == err) >- ((SpawnerInputStream)getErrorStream()).close(); >+ getErrorStream().close(); > if(null == in) >- ((SpawnerInputStream)getInputStream()).close(); >+ getInputStream().close(); > if(null == out) >- ((SpawnerOutputStream)getOutputStream()).close(); >+ getOutputStream().close(); > } catch (IOException e) { > } > // Grace before using the heavy gone.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
pawel.1.piech
:
iplog-
Actions:
View
|
Diff
Attachments on
bug 286162
:
185334
|
185407
| 185465