From: Timothy M. Jones Date: Thu, 22 Jul 2010 17:47:52 +0000 (+0100) Subject: Syscall: Don't close the simulator's standard file descriptors. X-Git-Tag: stable_2012_02_02~985 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0d301ca4c401ced27443711c34f37de60533e20c;p=gem5.git Syscall: Don't close the simulator's standard file descriptors. --- diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc index 4726decc5..7b12700e0 100644 --- 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;