[Box Backup-dev] Re: how to deal with mountpoints
Dave Bamford
boxbackup-dev at fluffy.co.uk
Tue May 16 10:21:22 BST 2006
Chris Wilson wrote:
> Hi Dave,
>
> On Mon, 8 May 2006, Dave Bamford wrote:
>
>> I hope you don't mind me contacting you via private email but I don't
>> think this is relevant for the Box list.
>
>
> Perhaps not for the users list, but I would say it definitely belongs
> on the developers' list, so I'm copying them in.
>
>> I am porting the latest 0.10 client to OS/2 and got it through
>> configure but had to edit the configure file when it tests for
>> mountpoints I substituted OS2-EMX for WINNT in the condition so it
>> did not exit.
>>
>> However coming to build the client it crashes out here
>> BackupDaemon.cpp: In member function `void
>> BackupDaemon::SetupLocations(BackupClientContext&, const
>> Configuration&)':
>> BackupDaemon.cpp:1400: error: `mountPoints' undeclared (first use this
>> function)
>
>
> You have "#undef HAVE_MOUNTS" in BoxConfig.h, so the definition of
> mountPoints is not compiled in. I suspect that the problem is this
> code, at line 1367 in trunk (maybe slightly different in 0.10):
>
> for(; i != mountPoints.end(); ++i)
>
> Just above it, at line 1338:
>
> #if defined HAVE_STRUCT_STATFS_F_MNTONNAME || defined
> HAVE_STRUCT_STATVFS_F_MNTONNAME || defined WIN32
> // BSD style statfs -- includes mount point, which is nice.
>
> We use a fake (emulated) statfs() function on Windows, which you can
> find in lib/win32/emu.cpp at line 758 or thereabouts. It uses the
> Windows API function GetFileInformationByHandle to return the volume
> identifier, and constructs a fake "mount point" for the file, based on
> the volume identifier.
>
> I don't know what the OS/2 API is like, but you might want to do
> something similar there. I don't think you can safely disable the
> entire #if ... #endif chunk (lines 1338 - 1383 of BackupDaemon.cpp),
> but you could try it if all else fails, and define a fake value for
> mountName.
>
> Cheers, Chris.
Hi Chris
I only just saw your reply in the list, monitoring emails is getting quite
time consuming.
Thanks for your reply - I got over the problem by editing the configure file
produced by autoconfigure and added os2-emx into this code
> if test "$target_os" != "mingw32" -a "$target_os" != "os2-emx"; then
> { { echo "$as_me:$LINENO: error: cannot work out how to discover
> mount points on your platform" >&5
> echo "$as_me: error: cannot work out how to discover mount points on
> your platform" >&2;}
> { (exit 1); exit 1; }; }
> fi
But I think the problem really got solved by fixing the build environment.
I did not have to change anything in BackupDaemon.cpp as some time ago I
built a polling
routine which seems to work, just have to add -lpoll to the makefiles.
I built bbackupd.exe and bbackupquery.exe, both work with 2 exceptions
for OS2.
In SocketStreamTLS::Close I had to comment out ::SSL_free(mpSSL) after
the SocketStream::Close();
Not sure why, but with it in I got "Abnormal Program Termination"
The only other thing was making sure the files were opened with O_BINARY.
Running bbackupquery retrned errors on the get command until I commented
out the GetAttribute code from BackupStoreFile::DecodeFile. I need to
look into
this as the attributes would be nice to have back
Can't generate the test code as I can't find a nanosleep() for OS/2.
And I also don't have a vfork (its on the todo list)
Cheers
Dave Bamford
More information about the Boxbackup-dev
mailing list