aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2012-12-04 02:35:09 +0100
committerPetr Machata <pmachata@redhat.com>2013-03-08 22:55:27 +0100
commitac50cada8721a633a92d4978c86078c117d2ae87 (patch)
treec198cd1f4ba766b051f4c1be5aa00eb86f48c117
parent7e6f2b3bd1c606c731a102f5417ff0caaf393f42 (diff)
downloadltrace-ac50cada8721a633a92d4978c86078c117d2ae87.tar.gz
read_config_file: Use passed-in protolib instead of the global one
-rw-r--r--read_config_file.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/read_config_file.c b/read_config_file.c
index eb7d842..0b32ec9 100644
--- a/read_config_file.c
+++ b/read_config_file.c
@@ -422,7 +422,7 @@ parse_typedef(struct protolib *plib, struct locus *loc, char **str)
/* Look through the typedef list whether we already have a
* forward of this type. If we do, it must be forward
* structure. */
- struct named_type *forward = protolib_lookup_type(&g_prototypes, name);
+ struct named_type *forward = protolib_lookup_type(plib, name);
if (forward != NULL
&& (forward->info->type != ARGTYPE_STRUCT
|| !forward->forward)) {
@@ -451,8 +451,7 @@ parse_typedef(struct protolib *plib, struct locus *loc, char **str)
this_nt.forward = fwd;
if (forward == NULL) {
- if (protolib_add_named_type(&g_prototypes, name,
- 1, &this_nt) < 0) {
+ if (protolib_add_named_type(plib, name, 1, &this_nt) < 0) {
named_type_destroy(&this_nt);
goto err;
}
@@ -1250,7 +1249,7 @@ read_config_file(struct protolib *plib, const char *path)
size_t len = 0;
while (getline(&line, &len, stream) >= 0) {
loc.line_no++;
- process_line(&g_prototypes, &loc, line);
+ process_line(plib, &loc, line);
}
free(line);