ENH: allocate fileMonitor only if wanted

This commit is contained in:
mattijs
2010-10-21 14:19:10 +01:00
parent 0ad7b2cda8
commit 7e0f1e2a01
4 changed files with 25 additions and 19 deletions

View File

@ -159,15 +159,21 @@ namespace Foam
{
if (inotifyFd_ < 0)
{
WarningIn("fileMonitorWatcher(const label)")
<< "Failed allocating an inotify descriptor : "
<< string(strerror(errno)) << endl
<< " Please increase the number of allowable "
<< "inotify instances" << endl
<< " (/proc/sys/fs/inotify/max_user_instances on Linux)"
<< endl
<< " Continuing without additional file monitoring."
<< endl;
static bool hasWarned = false;
if (!hasWarned)
{
hasWarned = true;
WarningIn("fileMonitorWatcher(const label)")
<< "Failed allocating an inotify descriptor : "
<< string(strerror(errno)) << endl
<< " Please increase the number of allowable "
<< "inotify instances" << endl
<< " (/proc/sys/fs/inotify/max_user_instances"
<< " on Linux)" << endl
<< " or switch off runTimeModifiable." << endl
<< " Continuing without additional file monitoring."
<< endl;
}
}
}