]> git.proxmox.com Git - libgit2.git/blobdiff - src/streams/registry.c
New upstream version 1.3.0+dfsg.1
[libgit2.git] / src / streams / registry.c
index 284431207cebcee86813d856733604ae93cb34c0..e60e1cd63e887e1ee0c71406eca7c86a734088ed 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "streams/registry.h"
 
-#include "global.h"
+#include "runtime.h"
 #include "streams/tls.h"
 #include "streams/mbedtls.h"
 #include "streams/openssl.h"
@@ -33,8 +33,7 @@ int git_stream_registry_global_init(void)
        if (git_rwlock_init(&stream_registry.lock) < 0)
                return -1;
 
-       git__on_shutdown(shutdown_stream_registry);
-       return 0;
+       return git_runtime_shutdown_register(shutdown_stream_registry);
 }
 
 GIT_INLINE(void) stream_registration_cpy(
@@ -52,7 +51,7 @@ int git_stream_registry_lookup(git_stream_registration *out, git_stream_t type)
        git_stream_registration *target;
        int error = GIT_ENOTFOUND;
 
-       assert(out);
+       GIT_ASSERT_ARG(out);
 
        switch(type) {
        case GIT_STREAM_STANDARD:
@@ -62,7 +61,7 @@ int git_stream_registry_lookup(git_stream_registration *out, git_stream_t type)
                target = &stream_registry.tls_callbacks;
                break;
        default:
-               assert(0);
+               git_error_set(GIT_ERROR_INVALID, "invalid stream type");
                return -1;
        }
 
@@ -82,7 +81,7 @@ int git_stream_registry_lookup(git_stream_registration *out, git_stream_t type)
 
 int git_stream_register(git_stream_t type, git_stream_registration *registration)
 {
-       assert(!registration || registration->init);
+       GIT_ASSERT(!registration || registration->init);
 
        GIT_ERROR_CHECK_VERSION(registration, GIT_STREAM_VERSION, "stream_registration");