authkey: Remove pa_authkey_load(), it's redundant

The only place where pa_authkey_load() was called was in
pa_authkey_load_auto(), and the only functionality that
pa_authkey_load() was to log a warning if load() fails. That log
message is now in pa_authkey_load_auto(), so pa_authkey_load() has no
use any more.
This commit is contained in:
Tanu Kaskinen 2014-06-08 16:32:55 +03:00
parent 5141188ca8
commit a54d357729
2 changed files with 3 additions and 16 deletions

View file

@ -131,20 +131,6 @@ finish:
return ret; return ret;
} }
/* Load a cookie from a cookie file. If the file doesn't exist, create it. */
int pa_authkey_load(const char *path, bool create, void *data, size_t length) {
int ret;
pa_assert(path);
pa_assert(data);
pa_assert(length > 0);
if ((ret = load(path, create, data, length)) < 0)
pa_log_warn("Failed to load authorization key '%s': %s", path, (ret < 0) ? pa_cstrerror(errno) : "File corrupt");
return ret;
}
/* If the specified file path starts with / return it, otherwise /* If the specified file path starts with / return it, otherwise
* return path prepended with home directory */ * return path prepended with home directory */
static char *normalize_path(const char *fn) { static char *normalize_path(const char *fn) {
@ -183,7 +169,9 @@ int pa_authkey_load_auto(const char *fn, bool create, void *data, size_t length)
if (!(p = normalize_path(fn))) if (!(p = normalize_path(fn)))
return -2; return -2;
ret = pa_authkey_load(p, create, data, length); if ((ret = load(p, create, data, length)) < 0)
pa_log_warn("Failed to load authorization key '%s': %s", p, (ret < 0) ? pa_cstrerror(errno) : "File corrupt");
pa_xfree(p); pa_xfree(p);
return ret; return ret;

View file

@ -24,7 +24,6 @@
#include <sys/types.h> #include <sys/types.h>
int pa_authkey_load(const char *path, bool create, void *data, size_t len);
int pa_authkey_load_auto(const char *fn, bool create, void *data, size_t length); int pa_authkey_load_auto(const char *fn, bool create, void *data, size_t length);
int pa_authkey_save(const char *path, const void *data, size_t length); int pa_authkey_save(const char *path, const void *data, size_t length);