From 3cb4e2386058fd0ab3fee963d7dce93bc28d432e Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Sun, 20 Jan 2013 19:33:43 +0100 Subject: [PATCH] Support for large files on 32 bit systems --- Makefile | 2 +- dirlisting.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9c18b8a..5b4139f 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ MAGIC_CFLAGS=-DHAVE_MAGIC MAGIC_LIBS=-lmagic CC=gcc -CFLAGS+=-Wall -pedantic -std=c99 -D_POSIX_C_SOURCE=20120607L $(MAGIC_CFLAGS) +CFLAGS+=-Wall -pedantic -std=c99 -D_POSIX_C_SOURCE=20120607L -D_FILE_OFFSET_BITS=64 $(MAGIC_CFLAGS) LIBS=-lmicrohttpd $(MAGIC_LIBS) TARGET=fileshare diff --git a/dirlisting.c b/dirlisting.c index dd54924..dd65bb0 100644 --- a/dirlisting.c +++ b/dirlisting.c @@ -21,11 +21,11 @@ struct Entry { char *name; - size_t size; + off_t size; uint8_t flags; }; -const char* format_size(size_t s) { +const char* format_size(off_t s) { static char buf[32]; const char *prefixes = " kMGTPEZY"; float fs = s;