From: Roland McGrath Date: Wed, 31 Dec 2008 08:21:04 +0000 (-0800) Subject: dwarf_haschildren: Return -1 for error case, not 0. X-Git-Tag: elfutils-0.139~29^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f6d2010bb26b6bf5395a98651fce9a1a9141ac3;p=thirdparty%2Felfutils.git dwarf_haschildren: Return -1 for error case, not 0. --- diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 235fac013..688437257 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,9 @@ +2008-12-31 Roland McGrath + + * libdwP.h (struct Dwarf_Abbrev): Change type of 'has_children' to bool. + Reorder members. + * dwarf_haschildren.c: Return -1 for error case, not 0. + 2008-08-15 Roland McGrath * libdw.map (ELFUTILS_0.136): New version set, inherits from diff --git a/libdw/dwarf_haschildren.c b/libdw/dwarf_haschildren.c index fe4319559..d9a47ad29 100644 --- a/libdw/dwarf_haschildren.c +++ b/libdw/dwarf_haschildren.c @@ -1,5 +1,5 @@ /* Return string associated with given attribute. - Copyright (C) 2003, 2005 Red Hat, Inc. + Copyright (C) 2003, 2005, 2008 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper , 2003. @@ -77,7 +77,7 @@ dwarf_haschildren (die) if (unlikely (die->abbrev == DWARF_END_ABBREV)) { __libdw_seterrno (DWARF_E_INVALID_DWARF); - return 0; + return -1; } return die->abbrev->has_children; diff --git a/libdw/libdwP.h b/libdw/libdwP.h index f805295ff..867ad89b4 100644 --- a/libdw/libdwP.h +++ b/libdw/libdwP.h @@ -194,12 +194,12 @@ struct Dwarf /* Abbreviation representation. */ struct Dwarf_Abbrev { + Dwarf_Off offset; + unsigned char *attrp; + unsigned int attrcnt; unsigned int code; unsigned int tag; - int has_children; - unsigned int attrcnt; - unsigned char *attrp; - Dwarf_Off offset; + bool has_children; }; #include "dwarf_abbrev_hash.h"