aboutsummaryrefslogtreecommitdiff
path: root/sim/common/callback.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>1997-11-20 00:47:02 +0000
committerDoug Evans <dje@google.com>1997-11-20 00:47:02 +0000
commitac1d2660b2017c95d828702c3bf421ee22e4e781 (patch)
tree7afe4e206b6802216225fad5bfa2393f92984cb2 /sim/common/callback.c
parent998d2c82757f98ce63b865dd8c7fe3eca08dcbb9 (diff)
downloadgdb-ac1d2660b2017c95d828702c3bf421ee22e4e781.zip
gdb-ac1d2660b2017c95d828702c3bf421ee22e4e781.tar.gz
gdb-ac1d2660b2017c95d828702c3bf421ee22e4e781.tar.bz2
* callback.c (cb_host_to_target_stat): Fix return values.
Diffstat (limited to 'sim/common/callback.c')
-rw-r--r--sim/common/callback.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sim/common/callback.c b/sim/common/callback.c
index 98f791a..068cea2 100644
--- a/sim/common/callback.c
+++ b/sim/common/callback.c
@@ -730,7 +730,8 @@ store (p, size, val, big_p)
/* Translate a host's stat struct into a target's.
BIG_P is non-zero if the target is big-endian.
- The result is the size of the target's stat struct. */
+ The result is the size of the target's stat struct,
+ or zero if an error occured during the translation. */
int
cb_host_to_target_stat (cb, hs, ts, big_p)
@@ -751,13 +752,13 @@ cb_host_to_target_stat (cb, hs, ts, big_p)
if (q == NULL)
{
/* FIXME: print error message */
- return;
+ return 0;
}
size = atoi (q + 1);
if (size == 0)
{
/* FIXME: print error message */
- return;
+ return 0;
}
if (strncmp (m, "st_dev", q - m) == 0)
@@ -773,6 +774,8 @@ cb_host_to_target_stat (cb, hs, ts, big_p)
if (m)
++m;
}
+
+ return p - (char *) ts;
}
/* Cover functions to the vfprintf callbacks.