projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9a3533e
)
Syscall: Don't close the simulator's standard file descriptors.
author
Timothy M. Jones
<tjones1@inf.ed.ac.uk>
Thu, 22 Jul 2010 17:47:52 +0000
(18:47 +0100)
committer
Timothy M. Jones
<tjones1@inf.ed.ac.uk>
Thu, 22 Jul 2010 17:47:52 +0000
(18:47 +0100)
src/sim/syscall_emul.cc
patch
|
blob
|
history
diff --git
a/src/sim/syscall_emul.cc
b/src/sim/syscall_emul.cc
index 4726decc5769aede1ed5d121691f85bbbc0e55b9..7b12700e0b8325e83b736952cda116bfc2813a00 100644
(file)
--- a/
src/sim/syscall_emul.cc
+++ b/
src/sim/syscall_emul.cc
@@
-186,7
+186,10
@@
closeFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
{
int index = 0;
int target_fd = p->getSyscallArg(tc, index);
- int status = close(p->sim_fd(target_fd));
+ int sim_fd = p->sim_fd(target_fd);
+ int status = 0;
+ if (sim_fd > 2)
+ status = close(sim_fd);
if (status >= 0)
p->free_fd(target_fd);
return status;