]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* callback.c (cb_host_to_target_stat): Fix return values.
authorDoug Evans <dje@google.com>
Thu, 20 Nov 1997 00:47:02 +0000 (00:47 +0000)
committerDoug Evans <dje@google.com>
Thu, 20 Nov 1997 00:47:02 +0000 (00:47 +0000)
sim/common/ChangeLog
sim/common/callback.c

index 3f618c9d247b87582c668cb8b0d45605373426ab..bbb76400ce7129fdbece08797acf8879d6c77c88 100644 (file)
@@ -1,5 +1,7 @@
 Wed Nov 19 12:02:41 1997  Doug Evans  <devans@seba.cygnus.com>
 
+       * callback.c (cb_host_to_target_stat): Fix return values.
+
        * cgen-sim.h (enum_signal_type): Delete.
        (engine_signal): Update prototype.
        * cgen-utils.c: Don't include <signal.h>.
index 98f791a0630ba2399084434c50c3dd67dfceb50a..068cea292e9ab44ee9017b0ff9a8c5d9bef85d50 100644 (file)
@@ -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;
 }
 \f
 /* Cover functions to the vfprintf callbacks.