[Box Backup] Bug fix - don't die on lstat failure

Ben Summers boxbackup@fluffy.co.uk
Tue, 14 Dec 2004 16:26:37 +0000

On 14 Dec 2004, at 16:17, Joe Krahn wrote:

> Nick Knight wrote:
>> From reading the docs on lstat and linux lfs when the compiler flags 
>> are
>> used to enable large file support this switches calls to the 64 bit
>> versions (lstat64).
>> Although in my experience if a bad lstat is called fro whatever reason
>> then the backup will die, I second a fix to make the lstat more like a
>> bad read...
>> Nick
> When you mention compiler flags, do you mean the following defines?
> Or is there also an actual compiler flag?
> In either case, are any large-file flags currently in the boxbackup 
> source?

This flag


is used on all compiler line under Linux if "working" [1] LFS support 
is detected by the ./configure script.

It is my understanding that -D_LARGEFILE_SOURCE merely makes the *64 
functions available. However, since all the source uses 64 bit offsets, 
using -D_FILE_OFFSET_BITS=64 makes more sense.

I have had reports of success backing up large files after this support 
was added (and an issue caused by zlib not meeting it's documentation 

Can you tell me which error you get from lstat? (the value of errno, 
looked up in the relevant header file.)


[1] By working, I mean that using the flag increases the size of off_t 
and the relevant members of struct stat to 64 bits.