diff options
author | Stef Walter <stefw@gnome.org> | 2012-12-17 22:38:11 +0100 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2013-02-05 14:54:53 +0100 |
commit | 83af40091fdc50a1da21d6cd2582ecef759bfb7c (patch) | |
tree | 4f2ae24d3042caab012ddd32363192c2f5d6d917 | |
parent | 1f47fbffe1befb30a1bd3dfcec079a8a9f2fd957 (diff) |
Some debug info about which files are being loaded
-rw-r--r-- | trust/token.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/trust/token.c b/trust/token.c index 8f2cb3d..4e6f6e9 100644 --- a/trust/token.c +++ b/trust/token.c @@ -36,6 +36,7 @@ #include "attrs.h" #include "compat.h" +#define P11_DEBUG_FLAG P11_DEBUG_TRUST #include "debug.h" #include "errno.h" #include "library.h" @@ -89,7 +90,17 @@ loader_load_file (p11_token *token, ret = p11_parse_file (token->parser, filename, flags, on_parser_object, token); - return ret == P11_PARSE_SUCCESS ? 1 : 0; + switch (ret) { + case P11_PARSE_SUCCESS: + p11_debug ("loaded: %s", filename); + return 1; + case P11_PARSE_UNRECOGNIZED: + p11_debug ("skipped: %s", filename); + return 0; + default: + p11_debug ("failed to parse: %s", filename); + return 0; + } } static int @@ -122,7 +133,7 @@ loader_load_directory (p11_token *token, } else if (!S_ISDIR (sb.st_mode)) { ret = loader_load_file (token, path, &sb, flags); - return_val_if_fail (ret > 0, ret); + return_val_if_fail (ret >= 0, ret); total += ret; } @@ -168,6 +179,8 @@ loader_load_paths (p11_token *token, char *path; int ret; + p11_debug ("loading paths: %s", paths); + while (paths) { pos = strchr (paths, ':'); if (pos == NULL) { |