From: Michael Tremer Date: Sat, 11 Jan 2025 18:59:59 +0000 (+0000) Subject: keys: Map them into memory X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0b94ce21672b96556843efee70318932c321a97f;p=people%2Fric9%2Fpakfire.git keys: Map them into memory Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/key.c b/src/pakfire/key.c index 003fca56c..d6adb5f83 100644 --- a/src/pakfire/key.c +++ b/src/pakfire/key.c @@ -923,8 +923,8 @@ int pakfire_key_signf(struct pakfire_key* key, FILE* s, FILE* f, const char* com size_t length = 0; int r; - // Load the entire content into memory - r = pakfire_read_file_into_buffer(f, &buffer, &length); + // Map the entire content into memory + r = pakfire_mmap(fileno(f), &buffer, &length); if (r < 0) goto ERROR; @@ -933,7 +933,7 @@ int pakfire_key_signf(struct pakfire_key* key, FILE* s, FILE* f, const char* com ERROR: if (buffer) - free(buffer); + munmap(buffer, length); return r; }