Ecere Software
/
sdk
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
51a4bdf
)
ecere/sys/DualPipe: (UNIX) Calling waitpid() in destructor
author
Jerome St-Louis
<jerome@ecere.com>
Sat, 22 Oct 2016 14:07:24 +0000
(10:07 -0400)
committer
Jerome St-Louis
<jerome@ecere.com>
Sat, 22 Oct 2016 15:13:26 +0000
(11:13 -0400)
- Also calling fclose() on handles
ecere/src/sys/DualPipe.c
patch
|
blob
|
history
diff --git
a/ecere/src/sys/DualPipe.c
b/ecere/src/sys/DualPipe.c
index
c9eba7c
..
62e6bff
100644
(file)
--- a/
ecere/src/sys/DualPipe.c
+++ b/
ecere/src/sys/DualPipe.c
@@
-63,17
+63,17
@@
void DualPipe_Destructor(_DualPipe * dp)
{
#if defined(__WIN32__)
if(dp->outputHandle)
- {
CloseHandle(dp->outputHandle);
- dp->outputHandle = null;
- }
if(dp->inputHandle)
- {
CloseHandle(dp->inputHandle);
- dp->inputHandle = null;
- }
if(dp->hProcess)
CloseHandle(dp->hProcess);
+#else
+ if(!dp->gotExitCode)
+ {
+ int status = 0;
+ waitpid(dp->pid, &status, WNOHANG);
+ }
#endif
free(dp);
}