From b7190c821e529d7858cff7c2fcc57304a1d38d2b Mon Sep 17 00:00:00 2001 From: Egeyar Bagcioglu Date: Wed, 3 Jun 2020 17:36:51 +0100 Subject: [PATCH] libctf, types: ensure the emission of ECTF_NOPARENT 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 libctf/ * ctf-types.c (ctf_variable_iter): Fix error return. --- libctf/ChangeLog | 4 ++++ libctf/ctf-types.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libctf/ChangeLog b/libctf/ChangeLog index 45caf217cb2..f3ac4cc91e7 100644 --- a/libctf/ChangeLog +++ b/libctf/ChangeLog @@ -1,3 +1,7 @@ +2020-07-22 Egeyar Bagcioglu + + * ctf-types.c (ctf_variable_iter): Fix error return. + 2020-07-22 Nick Alcock * ctf-open.c (ctf_bufopen_internal): Diagnose invalid flags. 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)) { -- 2.30.2