From: Stefan Schantl Date: Wed, 25 Nov 2015 08:06:46 +0000 (+0100) Subject: Drop function for fileposition initialization. X-Git-Tag: 2.0~69 X-Git-Url: http://git.ipfire.org/?p=people%2Fstevee%2Fguardian.git;a=commitdiff_plain;h=f7821b2361477128f27c8ff6838b47893b4482be Drop function for fileposition initialization. This function has been moved to the "Base" module. Signed-off-by: Stefan Schantl --- diff --git a/guardian b/guardian index c72a9dc..fd16b3a 100644 --- a/guardian +++ b/guardian @@ -247,35 +247,6 @@ sub Socket () { } } -# -## Function for fileposition initialization. -# -## This function is used to get the cursor position of the end of file (EOF) of -## a specified file. -# -## In order to prevent from permanently read and keep files opened, or dealing -## with huge logfiles, at initialization time of the worker processes, the file will -## be opened once and the cursor position of the end of file (EOF) get stored. -# -sub Init_fileposition ($) { - my $file = $_[0]; - - # Open the file. - open(FILE, $file) or die "Could not open $file. $!\n"; - - # Just seek to the end of the file (EOF). - seek(FILE, 0, 2); - - # Get and store the position. - my $position = tell(FILE), - - # Close the file again. - close(FILE); - - # Return the position. - return $position; -} - # ## Function for capturing process signals. #