1
0
Fork 0

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.

This commit is contained in:
Ralf Gerlich 2008-01-03 10:08:34 -08:00
parent d8539d5412
commit 05b9e47aba

View file

@ -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 );
}