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).
This commit is contained in:
Mathieu Othacehe 2017-11-03 13:40:07 +01:00
parent dd208b936c
commit b1a3079347
No known key found for this signature in database
GPG Key ID: 8354763531769CA6

View File

@ -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)))