[Box Backup-dev] Re: how to deal with mountpoints

Chris Wilson boxbackup-dev@fluffy.co.uk
Mon, 8 May 2006 22:45:54 +0000 (GMT)


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.
-- 
_ ___ __     _
  / __/ / ,__(_)_  | Chris Wilson <0000 at qwirx.com> - Cambs UK |
/ (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer |
\ _/_/_/_//_/___/ | We are GNU-free your mind-and your software |