(address . guix-patches@gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
* 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(-)
Toggle diff (24 lines)
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 3127b30..4424608 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)))
--
2.7.4