From 84745dfe33b9eaafafe6ae3203babd913ac7c893 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 9 Mar 2013 16:22:41 +0100 Subject: [PATCH] xbps_file_hash: remove madvise usage (no gain irl). --- lib/util_hash.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/util_hash.c b/lib/util_hash.c index f9938299..938a8563 100644 --- a/lib/util_hash.c +++ b/lib/util_hash.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2008-2012 Juan Romero Pardines. + * Copyright (c) 2008-2013 Juan Romero Pardines. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -107,12 +107,10 @@ xbps_file_hash(const char *file) if (buf == MAP_FAILED) return NULL; - (void)madvise(buf, mapsize, MADV_SEQUENTIAL); if (SHA256(buf, st.st_size, digest) == NULL) { munmap(buf, mapsize); return NULL; } - (void)madvise(buf, mapsize, MADV_DONTNEED); munmap(buf, mapsize); digest2string(digest, hash, SHA256_DIGEST_LENGTH);