summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDima Kogan <dima@secretsauce.net>2014-06-25 21:50:00 -0700
committerChanho Park <chanho61.park@samsung.com>2014-08-22 20:38:26 +0900
commita60a85bad96ac67ad1a8f5f53fed4f32c3f4303d (patch)
tree0cbda265eb31d543af10cf73e25191f24a2871b9
parentd536c7061bfad25a1a860a15e0698f3a02a06797 (diff)
downloadltrace-a60a85bad96ac67ad1a8f5f53fed4f32c3f4303d.tar.gz
ltrace-a60a85bad96ac67ad1a8f5f53fed4f32c3f4303d.tar.bz2
ltrace-a60a85bad96ac67ad1a8f5f53fed4f32c3f4303d.zip
clarified some int return code checking
-rw-r--r--library.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/library.c b/library.c
index c2f3fd1..562b52a 100644
--- a/library.c
+++ b/library.c
@@ -372,17 +372,16 @@ static int
library_exported_names_clone(struct library_exported_names *retp,
const struct library_exported_names *names)
{
- return
- DICT_CLONE(&retp->names, &names->names,
+ return (DICT_CLONE(&retp->names, &names->names,
const char*, uint64_t,
dict_clone_string, dtor_string,
NULL, NULL,
- NULL) ||
+ NULL) < 0 ||
DICT_CLONE(&retp->addrs, &names->addrs,
uint64_t, struct vect*,
NULL, NULL,
clone_vect, dtor_vect,
- NULL);
+ NULL) < 0) ? -1 : 0;
}
int library_exported_names_push(struct library_exported_names *names,
@@ -397,7 +396,7 @@ int library_exported_names_push(struct library_exported_names *names,
// push to the name->addr map
int result = DICT_INSERT(&names->names, &name, &addr);
- if (result == 1) {
+ if (result > 0) {
// This symbol is already present in the table. This library has
// multiple copies of this symbol (probably corresponding to
// different symbol versions). I should handle this gracefully
@@ -422,7 +421,8 @@ int library_exported_names_push(struct library_exported_names *names,
return -1;
VECT_INIT(aliases, const char*);
result = DICT_INSERT(&names->addrs, &addr, &aliases);
- if (result != 0)
+ assert(result <= 0);
+ if (result < 0)
return result;
}
else