From 1da99396dc65993ba34ac0370ca5d6acda6a3322 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 18 Mar 2018 07:02:37 -0400 Subject: [PATCH] Add support for gdbm-1.14. As of gdbm-1.14, 'gdbm_errno' no longer exists as a binary interface. It has been replaced by 'gdbm_errno_location', a function that returns int*. We now use this new interface if it's available. --- gdbm.scm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/gdbm.scm b/gdbm.scm index b92992f..4d38cc3 100644 --- a/gdbm.scm +++ b/gdbm.scm @@ -17,6 +17,9 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . +;; Modified by Mark H Weaver in March 2018 to support +;; gdbm-1.14 with its new 'gdbm_errno_location' interface. + (define-module (gdbm) #:use-module (system foreign) #:use-module (rnrs bytevectors) @@ -151,10 +154,21 @@ ;;; errors -(define %errno (dynamic-pointer "gdbm_errno" libgdbm)) +(define %list-int + (list int)) + +(define (dereference-int ptr) + (apply (lambda (errno) errno) + (parse-c-struct ptr %list-int))) + +(define %errno-location + (or (false-if-exception + (let ((func (dynamic-func "gdbm_errno_location" libgdbm))) + (pointer->procedure '* func '()))) + (const (dynamic-pointer "gdbm_errno" libgdbm)))) (define (gdbm-errno) - (pointer-address (dereference-pointer %errno))) + (dereference-int (%errno-location))) (define (gdbm-error) (error (pointer->string (%gdbm-strerror (gdbm-errno))))) -- 2.16.2 elect name='qt'>
AgeCommit message (Expand)Author
2019-12-08machine: Remove unnecessary record self-referencing bindings....'this-machine' and 'this-machine-ssh-configuration' were useless given that there are no thunked fields. * gnu/machine.scm (<machine>)[this-machine]: Remove. * gnu/machine/ssh.scm (<machine-ssh-configuration>) [this-machine-ssh-configuration]: Remove. Ludovic Courtès
2019-12-07machine: Add provenance tracking to each machine operating system....* gnu/machine.scm (<machine>): Rename accessor to '%machine-operating-system'. (machine-operating-system): New procedure. * doc/guix.texi (Service Reference): Mention it. Ludovic Courtès
2019-08-15machine: Implement 'roll-back-machine'....* gnu/machine.scm (roll-back-machine, &deploy-error, deploy-error?) (deploy-error-should-roll-back) (deploy-error-captured-args): New variable. * gnu/machine/ssh.scm (roll-back-managed-host): New variable. * guix/scripts/deploy.scm (guix-deploy): Roll-back systems when a deployment fails. Jakob L. Kreuze
2019-08-06machine: Rename 'system' field....* gnu/machine.scm (machine-system): Delete variable. (machine-operating-system): New variable. All callers changed. * doc/guix.texi (Invoking guix deploy): Use the 'machine-operating-system' accessor rather than 'machine-system'. Jakob L. Kreuze
2019-07-06gnu: Add machine type for deployment specifications....* gnu/machine.scm: New file. * gnu/machine/ssh.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. Jakob L. Kreuze