From b1a30793477c705a136546798d8e1d27802dd4b7 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Fri, 3 Nov 2017 13:40:07 +0100 Subject: [PATCH] system: vm: Use 2^32 - 1 as hash size. * gnu/system/vm.scm (operating-system-uuid): Use 2^32 - 1 instead of 2^32 as hash size. On some 32 bit system (ARM for example), 2^32 exceeds hash max size (ULONG_MAX = 2^32 - 1). --- gnu/system/vm.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 3127b305e1..44246083b3 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -372,13 +372,13 @@ TYPE (one of 'iso9660 or 'dce). Return a UUID object." (bytevector->uuid (uint-list->bytevector (list (hash file-system-type - (expt 2 32)) + (- (expt 2 32) 1)) (hash (operating-system-host-name os) - (expt 2 32)) + (- (expt 2 32) 1)) (hash (operating-system-services os) - (expt 2 32)) + (- (expt 2 32) 1)) (hash (operating-system-file-systems os) - (expt 2 32))) + (- (expt 2 32) 1))) (endianness little) 4) type)))