From 99ce67fa5579e70ff2275bf5c66f8534d7ca72f1 Mon Sep 17 00:00:00 2001 From: pschwan Date: Mon, 25 Mar 2002 01:55:49 +0000 Subject: [PATCH] - build truncate with LARGEFILE64_SOURCE - truncate's second argument is now in KB --- lustre/tests/Makefile.am | 2 +- lustre/tests/truncate.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lustre/tests/Makefile.am b/lustre/tests/Makefile.am index fd2ab55..dcd1b6d 100644 --- a/lustre/tests/Makefile.am +++ b/lustre/tests/Makefile.am @@ -1,4 +1,4 @@ -CFLAGS:=-g -I. -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I../include -Wall +CFLAGS:=-g -I. -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I../include -Wall -D_LARGEFILE64_SOURCE KFLAGS:= CPPFLAGS := # LDADD := -lreadline -ltermcap # -lefence diff --git a/lustre/tests/truncate.c b/lustre/tests/truncate.c index 66634dd..70fbbc7 100644 --- a/lustre/tests/truncate.c +++ b/lustre/tests/truncate.c @@ -6,16 +6,17 @@ int main(int argc, char **argv) { - unsigned long off; + unsigned long long off; int err; if (argc != 3) { - printf("usage %s file offset\n", argv[0]); + printf("usage %s file offset (kilobytes)\n", argv[0]); return 1; } off = strtoul(argv[2], NULL, 0); - err = truncate(argv[1], off); + off *= 1024; + err = truncate64(argv[1], off); if ( err ) { printf("Error truncating %s: %s\n", argv[1], strerror(errno)); } -- 1.8.3.1