diff options
author | Stef Walter <stef@thewalter.net> | 2013-07-17 18:08:11 +0200 |
---|---|---|
committer | Stef Walter <stef@thewalter.net> | 2013-07-18 13:04:37 +0200 |
commit | 9a1fe66f08149596567fedb4e2338ae786a19ab9 (patch) | |
tree | 562ee2eedc17f0dd83f62890d3b4d12f02ee5a72 /trust/token.c | |
parent | e403f7b33ac35e961c72ed1b6335bbe3084e4642 (diff) |
Avoid using the non-thread-safe strerror() function
https://bugzilla.redhat.com/show_bug.cgi?id=985481
Diffstat (limited to 'trust/token.c')
-rw-r--r-- | trust/token.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/trust/token.c b/trust/token.c index 12e9e4c..d2a12d0 100644 --- a/trust/token.c +++ b/trust/token.c @@ -226,8 +226,7 @@ loader_load_if_file (p11_token *token, if (stat (path, &sb) < 0) { if (errno == ENOENT) { - p11_message ("couldn't stat path: %s: %s", - path, strerror (errno)); + p11_message_err (errno, "couldn't stat path: %s", path); } } else if (!S_ISDIR (sb.st_mode)) { @@ -254,8 +253,7 @@ loader_load_directory (p11_token *token, /* First we load all the modules */ dir = opendir (directory); if (!dir) { - p11_message ("couldn't list directory: %s: %s", - directory, strerror (errno)); + p11_message_err (errno, "couldn't list directory: %s", directory); loader_not_loaded (token, directory); return 0; } @@ -297,10 +295,8 @@ loader_load_path (p11_token *token, int ret; if (stat (path, &sb) < 0) { - if (errno != ENOENT) { - p11_message ("cannot access trust certificate path: %s: %s", - path, strerror (errno)); - } + if (errno != ENOENT) + p11_message_err (errno, "cannot access trust certificate path: %s", path); loader_gone_file (token, path); return 0; } @@ -413,8 +409,7 @@ p11_token_reload (p11_token *token, if (errno == ENOENT) { loader_gone_file (token, origin); } else { - p11_message ("cannot access trust file: %s: %s", - origin, strerror (errno)); + p11_message_err (errno, "cannot access trust file: %s", origin); } return false; } @@ -459,7 +454,7 @@ check_directory (const char *path, free (parent); return ret; default: - p11_message ("couldn't access: %s: %s", path, strerror (errno)); + p11_message_err (errno, "couldn't access: %s", path); return false; } } @@ -600,7 +595,7 @@ mkdir_with_parents (const char *path) } /* fall through */ default: - p11_message ("couldn't create directory: %s: %s", path, strerror (errno)); + p11_message_err (errno, "couldn't create directory: %s", path); return false; } } |