1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-22 07:29:44 +02:00

Add more detail in error message from Monitor::run()

This commit is contained in:
Maarten ter Huurne 2014-08-18 16:29:18 +02:00
parent 9f1827dc24
commit 4740e274ed

View File

@ -29,19 +29,18 @@ bool Monitor::event_accepted(struct inotify_event &event)
int Monitor::run()
{
int wd, fd;
DEBUG("Starting inotify thread for path %s...\n", path.c_str());
fd = inotify_init1(IN_CLOEXEC);
int fd = inotify_init1(IN_CLOEXEC);
if (fd < 0) {
ERROR("Unable to start inotify\n");
return fd;
}
wd = inotify_add_watch(fd, path.c_str(), mask);
int wd = inotify_add_watch(fd, path.c_str(), mask);
if (wd < 0) {
ERROR("Unable to add inotify watch\n");
ERROR("Unable to add inotify watch on '%s': %s\n",
path.c_str(), strerror(errno));
close(fd);
return wd;
}