authkey: Remove pa_authkey_load(), it's redundant
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Sun, 8 Jun 2014 13:32:55 +0000 (16:32 +0300)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Tue, 24 Jun 2014 10:14:36 +0000 (13:14 +0300)
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.

src/pulsecore/authkey.c
src/pulsecore/authkey.h

index 03c0c4b..289e6c6 100644 (file)
@@ -131,20 +131,6 @@ finish:
     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
  * return path prepended with home directory */
 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)))
         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);
 
     return ret;
index df62d0c..ccda1fd 100644 (file)
@@ -24,7 +24,6 @@
 
 #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_save(const char *path, const void *data, size_t length);