From 05b9e47abaa66c2644f09b6c45d66c294e46e807 Mon Sep 17 00:00:00 2001 From: Ralf Gerlich Date: Thu, 3 Jan 2008 10:08:34 -0800 Subject: [PATCH] Replaced the fopen("MASTER_ON","r") in fgfs-tools-server by a simple access()-call. We only need to know whether it's there, not what's in there. --- src/BuildTiles/Parallel/client.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/BuildTiles/Parallel/client.cxx b/src/BuildTiles/Parallel/client.cxx index 51c47d6d..1636cde2 100644 --- a/src/BuildTiles/Parallel/client.cxx +++ b/src/BuildTiles/Parallel/client.cxx @@ -56,13 +56,10 @@ bool do_overwrite = true; void check_master_switch() { string file = work_base + "/Status/MASTER_ON"; - FILE *fp = fopen( file.c_str(), "r" ); - if ( fp == NULL ) { + if ( access( file.c_str(), F_OK ) != 0 ) { cout << "MASTER_ON file, " << file << " not found ... exiting." << endl; exit(0); } - - fclose( fp ); }