+Fri Oct 6 11:56:49 1995 Jim Wilson <wilson@chestnut.cygnus.com>
+
+ * callback.c (fdbad): Fix typo in comment.
+ (os_close, os_isatty, os_lseek, os_read, os_write): Use if statements
+ rather than || to get correct return value.
+ (os_write_stdout): Pass missing first argument to os_write.
+ * remote-sim.c: Include callback.h.
+ (_initialize_remote_sim): Call sim_set_callbacks and then initialize
+ the callbacks.
+
Thu Oct 5 17:28:09 1995 Per Bothner <bothner@kalessin.cygnus.com>
* values.c allocate_repeat_value): Allocate an array type, and
return val;
}
-/* Make sure the FD provided is ok. If not, return non -1
+/* Make sure the FD provided is ok. If not, return non-zero
and set errno. */
static int
host_callback *p;
int fd;
{
- return fdbad (p, fd) || wrap (p, close (fdmap (p, fd)));
+ int result;
+
+ result = fdbad (p, fd);
+ if (result)
+ return result;
+ result = wrap (p, close (fdmap (p, fd)));
+ return result;
}
int
host_callback *p;
int fd;
{
- return fdbad (p, fd) || wrap (p, isatty (fdmap (fd)));
+ int result;
+
+ result = fdbad (p, fd);
+ if (result)
+ return result;
+ result = wrap (p, isatty (fdmap (fd)));
+ return result;
}
int
long off;
int way;
{
- return fdbad (p, fd) || lseek (fdmap (p, fd), off, way);
+ int result;
+
+ result = fdbad (p, fd);
+ if (result)
+ return result;
+ result = lseek (fdmap (p, fd), off, way);
+ return result;
}
int
char *buf;
int len;
{
- return fdbad (p, fd) || wrap (p, read (fdmap (p, fd), buf, len));
+ int result;
+
+ result = fdbad (p, fd);
+ if (result)
+ return result;
+ result = wrap (p, read (fdmap (p, fd), buf, len));
+ return result;
}
int
const char *buf;
int len;
{
- return fdbad (p, fd) || wrap (p, write (fdmap (p, fd), buf, len));
+ int result;
+
+ result = fdbad (p, fd);
+ if (result)
+ return result;
+ result = wrap (p, write (fdmap (p, fd), buf, len));
+ return result;
}
/* ignore the grossness of INSIDE_SIMULATOR, it will go away one day. */
int len;
{
#ifdef INSIDE_SIMULATOR
- return os_write (1, buf, len);
+ return os_write (p, 1, buf, len);
#else
int i;
char b[2];