all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob c5a60fdefc6fab9367372cad16ff19c3e9977216 1420 bytes (raw)
name: gnu/packages/patches/mesa-fix-disk-cache-test-32bit.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
 
This fixes a test failure on 32bit architectures.

Patch adapted from upstream source repository:

https://cgit.freedesktop.org/mesa/mesa/commit/?id=61bbb25a080e48a8ca897ba7f6e73cc6a8e9b5b8

From a2121a13b912c5c3cc2aa22009c978b69b3bbadc Mon Sep 17 00:00:00 2001
From: Grazvydas Ignotas <notasas@gmail.com>
Date: Thu, 9 Mar 2017 02:54:53 +0200
Subject: [PATCH] util/disk_cache: fix size subtraction on 32bit

Negating size_t on 32bit produces a 32bit result. This was effectively
adding values close to UINT_MAX to the cache size (the files are usually
small) instead of intended subtraction.
Fixes 'make check' disk_cache failures on 32bit.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
---
 src/util/disk_cache.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
index d3e8b40123..ea7832d29e 100644
--- a/src/util/disk_cache.c
+++ b/src/util/disk_cache.c
@@ -521,7 +521,7 @@ evict_random_item(struct disk_cache *cache)
    free(dir_path);
 
    if (size) {
-      p_atomic_add(cache->size, - size);
+      p_atomic_add(cache->size, - (uint64_t)size);
       return;
    }
 
@@ -542,7 +542,7 @@ evict_random_item(struct disk_cache *cache)
    free(dir_path);
 
    if (size)
-      p_atomic_add(cache->size, - size);
+      p_atomic_add(cache->size, - (uint64_t)size);
 }
 
 void
-- 
2.12.2


debug log:

solving c5a60fdef ...
found c5a60fdef in https://yhetil.org/guix/87k26huuvp.fsf@fastmail.com/

applying [1/1] https://yhetil.org/guix/87k26huuvp.fsf@fastmail.com/
diff --git a/gnu/packages/patches/mesa-fix-disk-cache-test-32bit.patch b/gnu/packages/patches/mesa-fix-disk-cache-test-32bit.patch
new file mode 100644
index 000000000..c5a60fdef

1:35: trailing whitespace.
 
1:41: trailing whitespace.
 
1:44: trailing whitespace.
 
1:49: trailing whitespace.
 
1:51: trailing whitespace.
-- 
Checking patch gnu/packages/patches/mesa-fix-disk-cache-test-32bit.patch...
Applied patch gnu/packages/patches/mesa-fix-disk-cache-test-32bit.patch cleanly.
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.

index at:
100644 c5a60fdefc6fab9367372cad16ff19c3e9977216	gnu/packages/patches/mesa-fix-disk-cache-test-32bit.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.