libctf, types: ensure the emission of ECTF_NOPARENT
authorEgeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
Wed, 3 Jun 2020 16:36:51 +0000 (17:36 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Wed, 22 Jul 2020 17:01:51 +0000 (18:01 +0100)
ctf_variable_iter was returning a (positive!) error code rather than
setting the error in the passed-in ctf_file_t.

Reviewed-by: Nick Alcock <nick.alcock@oracle.com>
libctf/
* ctf-types.c (ctf_variable_iter): Fix error return.

libctf/ChangeLog
libctf/ctf-types.c

index 45caf217cb22244ad586c26f80b5d8909f777a90..f3ac4cc91e7798f921d97a90a592e750d12ec7c1 100644 (file)
@@ -1,3 +1,7 @@
+2020-07-22  Egeyar Bagcioglu  <egeyar.bagcioglu@oracle.com>
+
+       * ctf-types.c (ctf_variable_iter): Fix error return.
+
 2020-07-22  Nick Alcock  <nick.alcock@oracle.com>
 
        * ctf-open.c (ctf_bufopen_internal): Diagnose invalid flags.
index d7ed0e31dca3d3926e59f9a4d15c439d5e7ee135..550068250fda4edf974cce5527152c076673faf9 100644 (file)
@@ -495,7 +495,7 @@ ctf_variable_iter (ctf_file_t *fp, ctf_variable_f *func, void *arg)
   int rc;
 
   if ((fp->ctf_flags & LCTF_CHILD) && (fp->ctf_parent == NULL))
-    return ECTF_NOPARENT;
+    return (ctf_set_errno (fp, ECTF_NOPARENT));
 
   if (!(fp->ctf_flags & LCTF_RDWR))
     {