diff options
author | Daiki Ueno <ueno@gnu.org> | 2021-04-25 04:21:11 +0000 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2021-04-25 04:21:11 +0000 |
commit | 2e8bfb2844514a7fe0487104bf112530d93cf9e4 (patch) | |
tree | 0c5ea7872cd789ed18e3afa92622e3d4d367a2d4 | |
parent | badb8e4a67bd0b5657f5f7d2fe4d48f2bba30283 (diff) | |
parent | 6853ceb0fc790d09a8905a3991bca4d9aab07542 (diff) | |
download | gnutls-2e8bfb2844514a7fe0487104bf112530d93cf9e4.tar.gz |
Merge branch 'wip-guile-fixes' into 'master'
Minor Guile bindings improvements.
See merge request gnutls/gnutls!1413
-rw-r--r-- | guile/modules/gnutls/build/tests.scm | 5 | ||||
-rw-r--r-- | guile/src/core.c | 15 |
2 files changed, 11 insertions, 9 deletions
diff --git a/guile/modules/gnutls/build/tests.scm b/guile/modules/gnutls/build/tests.scm index 2c5c573f65..549917e838 100644 --- a/guile/modules/gnutls/build/tests.scm +++ b/guile/modules/gnutls/build/tests.scm @@ -1,5 +1,5 @@ ;;; GnuTLS --- Guile bindings for GnuTLS. -;;; Copyright (C) 2011-2012, 2016 Free Software Foundation, Inc. +;;; Copyright (C) 2011-2012, 2016, 2021 Free Software Foundation, Inc. ;;; ;;; GnuTLS is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU Lesser General Public @@ -35,7 +35,8 @@ display a backtrace. Otherwise, return THUNK's return value." (lambda () #t) (lambda () (format (current-error-port) - "~%throw to `~a' with args ~s~%" key args) + "~%throw to `~a' with args ~s [PID ~a]~%" + key args (getpid)) (display-backtrace (make-stack #t) (current-output-port))) (lambda () (exit 1))) diff --git a/guile/src/core.c b/guile/src/core.c index d78e53bbc9..972347d782 100644 --- a/guile/src/core.c +++ b/guile/src/core.c @@ -1,5 +1,5 @@ /* GnuTLS --- Guile bindings for GnuTLS. - Copyright (C) 2007-2014, 2016, 2019 Free Software Foundation, Inc. + Copyright (C) 2007-2014, 2016, 2019, 2020, 2021 Free Software Foundation, Inc. GnuTLS is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -96,11 +96,13 @@ const char scm_gnutls_array_error_message[] = static SCM weak_refs; /* Register a weak reference from @FROM to @TO, such that the lifetime of TO is - greater than or equal to that of FROM. */ + greater than or equal to that of FROM. TO is added to the list of weak + references of FROM. */ static void register_weak_reference (SCM from, SCM to) { - scm_hashq_set_x (weak_refs, from, to); + SCM refs = scm_cons (to, scm_hashq_ref (weak_refs, from, SCM_EOL)); + scm_hashq_set_x (weak_refs, from, refs); } @@ -2733,7 +2735,7 @@ SCM_DEFINE (scm_gnutls_x509_certificate_key_id, "x509-certificate-key-id", SCM result; scm_t_array_handle c_id_handle; gnutls_x509_crt_t c_cert; - scm_t_uint8 *c_id; + uint8_t *c_id; size_t c_id_len = 20; c_cert = scm_to_gnutls_x509_certificate (cert, 1, FUNC_NAME); @@ -2765,7 +2767,7 @@ SCM_DEFINE (scm_gnutls_x509_certificate_authority_key_id, SCM result; scm_t_array_handle c_id_handle; gnutls_x509_crt_t c_cert; - scm_t_uint8 *c_id; + uint8_t *c_id; size_t c_id_len = 20; c_cert = scm_to_gnutls_x509_certificate (cert, 1, FUNC_NAME); @@ -2796,7 +2798,7 @@ SCM_DEFINE (scm_gnutls_x509_certificate_subject_key_id, SCM result; scm_t_array_handle c_id_handle; gnutls_x509_crt_t c_cert; - scm_t_uint8 *c_id; + uint8_t *c_id; size_t c_id_len = 20; c_cert = scm_to_gnutls_x509_certificate (cert, 1, FUNC_NAME); @@ -3422,7 +3424,6 @@ scm_init_gnutls (void) { #include "core.x" - /* Use Guile's allocation routines, which will run the GC if need be. */ (void) gnutls_global_init (); scm_gnutls_define_enums (); |