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:
parent
d8539d5412
commit
05b9e47aba
1 changed files with 1 additions and 4 deletions
|
@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue