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 185407 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 use PTY streams and ignore error on close
286162.patch (text/plain), 3.64 KB, created by
Anton Leherbauer
on 2010-12-17 04:15:58 EST
(
hide
)
Description:
Spawner to use PTY streams and ignore error on close
Filename:
MIME Type:
Creator:
Anton Leherbauer
Created:
2010-12-17 04:15:58 EST
Size:
3.64 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 09:02:22 -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 09:02:22 -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; > } > >@@ -179,12 +191,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 +222,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
Actions:
View
|
Diff
Attachments on
bug 286162
:
185334
|
185407
|
185465