Add more debug in case inotify fails

We should probably make this at least a visible error, because it's a
limitation set by the kernel/the distro and we would require root
permissions to adjust the value.

Right now all that happens is that syncing is not immediate, but only
run every 30 secs (due to server polling).
This commit is contained in:
Daniel Molkentin 2013-02-14 16:27:25 +01:00
parent 8dd97a358a
commit bfbec24f43

View file

@ -39,8 +39,10 @@ INotify::INotify(QObject *parent, int mask)
_mask(mask) _mask(mask)
{ {
_fd = inotify_init(); _fd = inotify_init();
if (_fd == -1)
qDebug() << Q_FUNC_INFO << "notify_init() failed: " << strerror(errno);
_notifier = new QSocketNotifier(_fd, QSocketNotifier::Read); _notifier = new QSocketNotifier(_fd, QSocketNotifier::Read);
QObject::connect(_notifier, SIGNAL(activated(int)), SLOT(slotActivated(int))); connect(_notifier, SIGNAL(activated(int)), SLOT(slotActivated(int)));
_buffer_size = DEFAULT_READ_BUFFERSIZE; _buffer_size = DEFAULT_READ_BUFFERSIZE;
_buffer = (char *) malloc(_buffer_size); _buffer = (char *) malloc(_buffer_size);
} }
@ -121,7 +123,7 @@ void INotify::addPath(const QString &path)
if( wd > -1 ) if( wd > -1 )
_wds[path] = wd; _wds[path] = wd;
else else
qDebug() << "WRN: Could not watch " << path; qDebug() << "WRN: Could not watch " << path << ':' << strerror(errno);
} }
void INotify::removePath(const QString &path) void INotify::removePath(const QString &path)