[31/59] libctf, types: ensure the emission of ECTF_NOPARENT

Message ID 20200630233146.338613-32-nick.alcock@oracle.com
State New
Headers show
Series
  • Deduplicating CTF linker
Related show

Commit Message

H.J. Lu via Binutils June 30, 2020, 11:31 p.m.
From: Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>


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/ctf-types.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.27.0.247.g3dff7de930

Patch

diff --git a/libctf/ctf-types.c b/libctf/ctf-types.c
index d7ed0e31dca..550068250fd 100644
--- a/libctf/ctf-types.c
+++ b/libctf/ctf-types.c
@@ -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))
     {