diff options
| author | Roland McGrath <[email protected]> | 2008-12-31 00:21:04 -0800 |
|---|---|---|
| committer | Roland McGrath <[email protected]> | 2008-12-31 00:21:04 -0800 |
| commit | 1f6d2010bb26b6bf5395a98651fce9a1a9141ac3 (patch) | |
| tree | 511b32bf01db236e8f2641195058697d4a29732f | |
| parent | ec32ff94cfcb52f0bd5a5b00968fd590d444c306 (diff) | |
dwarf_haschildren: Return -1 for error case, not 0.
| -rw-r--r-- | libdw/ChangeLog | 6 | ||||
| -rw-r--r-- | libdw/dwarf_haschildren.c | 4 | ||||
| -rw-r--r-- | libdw/libdwP.h | 8 |
3 files changed, 12 insertions, 6 deletions
diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 235fac01..68843725 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,9 @@ +2008-12-31 Roland McGrath <[email protected]> + + * 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 <[email protected]> * libdw.map (ELFUTILS_0.136): New version set, inherits from diff --git a/libdw/dwarf_haschildren.c b/libdw/dwarf_haschildren.c index fe431955..d9a47ad2 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 <[email protected]>, 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 f805295f..867ad89b 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" |
