diff --git a/.gitignore b/.gitignore index ddecb497..05c5188b 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ configure depcomp install-sh missing +bin diff --git a/projects/VC7.1/fgfs-launch-clients/.gitignore b/projects/VC7.1/fgfs-launch-clients/.gitignore new file mode 100644 index 00000000..0f3a6b1b --- /dev/null +++ b/projects/VC7.1/fgfs-launch-clients/.gitignore @@ -0,0 +1,2 @@ +Debug +Release diff --git a/projects/VC7.1/fgfs-launch-clients/fgfs-launch-clients.vcproj b/projects/VC7.1/fgfs-launch-clients/fgfs-launch-clients.vcproj new file mode 100644 index 00000000..387d6761 --- /dev/null +++ b/projects/VC7.1/fgfs-launch-clients/fgfs-launch-clients.vcproj @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/projects/VC7.1/terragear.sln b/projects/VC7.1/terragear.sln index 30b36a2a..6cd4aa83 100644 --- a/projects/VC7.1/terragear.sln +++ b/projects/VC7.1/terragear.sln @@ -202,6 +202,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fgfs-launch-server", "fgfs- {22540CD3-D3CA-4C86-A773-80AEEE3ACDED} = {22540CD3-D3CA-4C86-A773-80AEEE3ACDED} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fgfs-launch-clients", "fgfs-launch-clients\fgfs-launch-clients.vcproj", "{4CCE2136-24FC-4F7A-A609-8018F00F9042}" + ProjectSection(ProjectDependencies) = postProject + {22540CD3-D3CA-4C86-A773-80AEEE3ACDED} = {22540CD3-D3CA-4C86-A773-80AEEE3ACDED} + EndProjectSection +EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -352,6 +357,10 @@ Global {5086D5EB-5EC0-437F-8181-264315F21A17}.Debug.Build.0 = Debug|Win32 {5086D5EB-5EC0-437F-8181-264315F21A17}.Release.ActiveCfg = Release|Win32 {5086D5EB-5EC0-437F-8181-264315F21A17}.Release.Build.0 = Release|Win32 + {4CCE2136-24FC-4F7A-A609-8018F00F9042}.Debug.ActiveCfg = Debug|Win32 + {4CCE2136-24FC-4F7A-A609-8018F00F9042}.Debug.Build.0 = Debug|Win32 + {4CCE2136-24FC-4F7A-A609-8018F00F9042}.Release.ActiveCfg = Release|Win32 + {4CCE2136-24FC-4F7A-A609-8018F00F9042}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection diff --git a/src/BuildTiles/Parallel/client.cxx b/src/BuildTiles/Parallel/client.cxx index c7dd8c7d..5f1ef534 100644 --- a/src/BuildTiles/Parallel/client.cxx +++ b/src/BuildTiles/Parallel/client.cxx @@ -10,22 +10,30 @@ # include // BSD macro definitions #endif -#include // FD_ISSET(), etc. +#ifdef _MSC_VER +# include +# include +# include +# define sleep(a) Sleep(a) +# define pid_t int +#else +# include // FD_ISSET(), etc. +# include +# include +# include +# include +# include +# include // bcopy() on Irix +#endif #include -#include -#include -#include -#include +#include #include -#include #include -#include #include #include // atoi() #include // bcopy(), sterror() -#include // bcopy() on Irix #include @@ -35,6 +43,8 @@ #include +#include + using std::cout; using std::cerr; using std::endl; @@ -56,7 +66,7 @@ bool do_overwrite = true; void check_master_switch() { string file = work_base + "/Status/MASTER_ON"; - if ( access( file.c_str(), F_OK ) != 0 ) { + if ( access( file.c_str(), 0 ) != 0 ) { cout << "MASTER_ON file, " << file << " not found ... exiting." << endl; exit(0); } @@ -66,7 +76,7 @@ void check_master_switch() { // check if the host system is free of interactive users int system_free() { -#if !defined(BSD) && !defined(__CYGWIN__) +#if !defined(BSD) && !defined(__CYGWIN__) && !defined(_MSC_VER) struct utmp *uptr; setutent(); @@ -83,8 +93,10 @@ int system_free() { } endutent(); -#else +#elif !defined(_MSC_VER) # warning Port me +#else +# pragma message( "Port me" ) #endif return 1; @@ -215,17 +227,17 @@ static bool must_generate( const SGBucket& b ) { size_t prefix_len=prefix.size(); for (int i = 0; i < (int)load_dirs.size(); i++) { string path=load_dirs[i]+"/"+b.gen_base_path(); - DIR *loaddir=opendir(path.c_str()); + ulDir *loaddir=ulOpenDir(path.c_str()); if (!loaddir) { if (errno!=ENOENT) cout << " Could not open load directory " << path << ":" << strerror(errno) << "\n"; continue; } - struct dirent* de; + struct ulDirEnt* de; struct stat src_stat; - while ((de=readdir(loaddir))) { + while ((de=ulReadDir(loaddir))) { if (strncmp(de->d_name,prefix.c_str(),prefix_len)) continue; string file=path+"/"+de->d_name; @@ -236,12 +248,12 @@ static bool must_generate( const SGBucket& b ) { } if ( have_btg && src_stat.st_mtime>btg_stat.st_mtime ) { cout << " File " << file << " is newer than btg-file => rebuild\n"; - closedir(loaddir); + ulCloseDir(loaddir); return true; } if ( have_stg && src_stat.st_mtime>stg_stat.st_mtime ) { cout << " File " << file << " is newer than stg-file => rebuild\n"; - closedir(loaddir); + ulCloseDir(loaddir); return true; } /* Ignore elevation data, as it is not used if we have no @@ -252,12 +264,12 @@ static bool must_generate( const SGBucket& b ) { continue; if ( !(have_stg && have_btg) ) { cout << " There is source-data (" << file << ") for tile " << b.gen_index_str() << " but .btg or .stg is missing => build\n"; - closedir(loaddir); + ulCloseDir(loaddir); return true; } } - closedir(loaddir); + ulCloseDir(loaddir); } return false; @@ -395,8 +407,8 @@ int main(int argc, char *argv[]) { pid_t pid = getpid(); char tmp[MAXBUF]; - sprintf(tmp, "/tmp/result.%s.%d", hostname, pid); - string result_file = tmp; + sprintf(tmp, "result.%s.%d.", hostname, pid); + string result_file = tempnam( 0, tmp ); last_tile = 0;