From 033979688160f67d7e8e10ea5562a1756a917e87 Mon Sep 17 00:00:00 2001 From: Rene Rebe Date: Mon, 9 May 2005 13:48:37 +0000 Subject: [PATCH] Rene Rebe: Fixed fl_wrapper for big (>2GB) files [2005041811175732415] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@5949 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- misc/tools-source/fl_wrapper.c | 19 ++++++++++++++++--- misc/tools-source/fl_wrapper.c.sh | 13 +++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/misc/tools-source/fl_wrapper.c b/misc/tools-source/fl_wrapper.c index dcabb4760..4eace956e 100644 --- a/misc/tools-source/fl_wrapper.c +++ b/misc/tools-source/fl_wrapper.c @@ -8,7 +8,7 @@ * the ./scripts/Create-CopyPatch script. Do not edit this copyright text! * * ROCK Linux: rock-src/misc/tools-source/fl_wrapper.c.sh - * ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf + * ROCK Linux is Copyright (C) 1998 - 2005 Clifford Wolf * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,6 +22,8 @@ * * --- ROCK-COPYRIGHT-NOTE-END --- * + * Copyright (C) 2004-2005 The T2 SDE Project + * * gcc -Wall -O2 -ldl -shared -o fl_wrapper.so fl_wrapper.c * * !!! THIS FILE IS AUTO-GENERATED BY fl_wrapper.c.sh !!! @@ -45,6 +47,9 @@ #define open64 xxx_open64 #define mknod xxx_mknod +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE + # include # include # include @@ -57,6 +62,9 @@ # include # include +#undef _LARGEFILE64_SOURCE +#undef _LARGEFILE_SOURCE + #undef mknod #undef open #undef open64 @@ -708,8 +716,8 @@ execvp (file, argv) * the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by * the ./scripts/Create-CopyPatch script. Do not edit this copyright text! * - * ROCK Linux: rock-src/misc/tools-source/fl_wrapper.c.sh - * ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf + * ROCK Linux: rock-src/misc/tools-source/fl_wrapper_open.c + * ROCK Linux is Copyright (C) 1998 - 2005 Clifford Wolf * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -959,7 +967,12 @@ static void handle_file_access_after(const char * func, const char * file, else { logfile = rlog; } if ( logfile == 0 ) return; +#ifdef __USE_LARGEFILE + fd=open64(logfile,O_APPEND|O_WRONLY|O_LARGEFILE,0); +#else +#warning "The wrapper library will not work properly for large logs!" fd=open(logfile,O_APPEND|O_WRONLY,0); +#endif if (fd == -1) return; if (file[0] == '/') { diff --git a/misc/tools-source/fl_wrapper.c.sh b/misc/tools-source/fl_wrapper.c.sh index 1dfccc9d6..e9af2d04e 100644 --- a/misc/tools-source/fl_wrapper.c.sh +++ b/misc/tools-source/fl_wrapper.c.sh @@ -27,6 +27,8 @@ cat << EOT * * --- ROCK-COPYRIGHT-NOTE-END --- * + * Copyright (C) 2004-2005 The T2 SDE Project + * * gcc -Wall -O2 -ldl -shared -o fl_wrapper.so fl_wrapper.c * * !!! THIS FILE IS AUTO-GENERATED BY $0 !!! @@ -50,6 +52,9 @@ cat << EOT #define open64 xxx_open64 #define mknod xxx_mknod +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE + # include # include # include @@ -62,6 +67,9 @@ cat << EOT # include # include +#undef _LARGEFILE64_SOURCE +#undef _LARGEFILE_SOURCE + #undef mknod #undef open #undef open64 @@ -327,7 +335,12 @@ static void handle_file_access_after(const char * func, const char * file, else { logfile = rlog; } if ( logfile == 0 ) return; +#ifdef __USE_LARGEFILE + fd=open64(logfile,O_APPEND|O_WRONLY|O_LARGEFILE,0); +#else +#warning "The wrapper library will not work properly for large logs!" fd=open(logfile,O_APPEND|O_WRONLY,0); +#endif if (fd == -1) return; if (file[0] == '/') {