* gloss.cxx (gloss32::reset): Move check for std streams into
hostops::close.
* hostops.cxx (hostops::close): Don't close host std streams.
+2001-04-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ * gloss.cxx (gloss32::reset): Move check for std streams into
+ hostops::close.
+ * hostops.cxx (hostops::close): Don't close host std streams.
+
2001-01-26 Nicholas Duffek <nsd@redhat.com>
* gloss.cxx (gloss32::do_sys_exit): Pass exit value in bits 8..15
for (int i = 0; i < max_fds; ++i)
{
int errcode;
- if (fd_table[i] > 2)
- if (! host_ops->close (fd_table[i], errcode))
- cerr << "*** While resetting, close("
+ if (! host_ops->close (fd_table[i], errcode))
+ cerr << "*** While resetting, close("
<< fd_table[i]
<< ") unexpectedly failed." << endl;
}
bool
hostops::close (int fd, int& errcode)
{
- if (::close (fd) < 0)
- {
- errcode = errno;
- return false;
+ /* don't close the host's stdin, stdout, and stderr */
+ if (fd > 2)
+ {
+ if (::close (fd) < 0)
+ {
+ errcode = errno;
+ return false;
+ }
}
return true;
}