aboutsummaryrefslogtreecommitdiff
path: root/devel/ccache/files
diff options
context:
space:
mode:
authorMichael Johnson <ahze@FreeBSD.org>2009-08-05 02:40:48 +0000
committerMichael Johnson <ahze@FreeBSD.org>2009-08-05 02:40:48 +0000
commitba71064e44ee9c00a3aa363d5061b70d460d8b60 (patch)
tree7c7dfcd166a4ddaa37a4caf1cb90ddc414b20bb0 /devel/ccache/files
parente316a3ed4a9db51a7d8b00ec037267ae649007aa (diff)
downloadports-ba71064e44ee9c00a3aa363d5061b70d460d8b60.tar.gz
ports-ba71064e44ee9c00a3aa363d5061b70d460d8b60.zip
Notes
Diffstat (limited to 'devel/ccache/files')
-rw-r--r--devel/ccache/files/patch-md422
1 files changed, 13 insertions, 9 deletions
diff --git a/devel/ccache/files/patch-md4 b/devel/ccache/files/patch-md4
index 751296e91af4..7e9ff7339167 100644
--- a/devel/ccache/files/patch-md4
+++ b/devel/ccache/files/patch-md4
@@ -17,8 +17,8 @@
void cc_log(const char *format, ...);
void fatal(const char *msg);
---- hash.c.orig Wed Sep 8 21:36:22 2004
-+++ hash.c Wed Sep 8 21:36:25 2004
+--- hash.c.orig 2004-09-13 12:38:30.000000000 +0200
++++ hash.c 2009-07-21 23:37:00.000000000 +0200
@@ -20,17 +20,22 @@
*/
@@ -46,7 +46,7 @@
}
void hash_string(const char *s)
-@@ -46,35 +51,40 @@
+@@ -46,35 +51,44 @@
/* add contents of a file to the hash */
void hash_file(const char *fname)
{
@@ -72,12 +72,16 @@
+ close(fd);
+ fatal(__FUNCTION__);
+ }
-+ buf = mmap(NULL, stats.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
-+ if (buf == MAP_FAILED) {
-+ cc_log("Failed to mmap %s\n", fname);
-+ close(fd);
-+ fatal(__FUNCTION__);
-+ }
++ if( stats.st_size == 0 )
++ buf = NULL;
++ else {
++ buf = mmap(NULL, stats.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
++ if (buf == MAP_FAILED) {
++ cc_log("Failed to mmap %s\n", fname);
++ close(fd);
++ fatal(__FUNCTION__);
++ }
++ }
+
+ hash_buffer(buf, stats.st_size);
close(fd);