mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-25 18:05:20 +02:00
Add more detail in error message from Monitor::run()
This commit is contained in:
parent
9f1827dc24
commit
4740e274ed
@ -29,19 +29,18 @@ bool Monitor::event_accepted(struct inotify_event &event)
|
|||||||
|
|
||||||
int Monitor::run()
|
int Monitor::run()
|
||||||
{
|
{
|
||||||
int wd, fd;
|
|
||||||
|
|
||||||
DEBUG("Starting inotify thread for path %s...\n", path.c_str());
|
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) {
|
if (fd < 0) {
|
||||||
ERROR("Unable to start inotify\n");
|
ERROR("Unable to start inotify\n");
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
wd = inotify_add_watch(fd, path.c_str(), mask);
|
int wd = inotify_add_watch(fd, path.c_str(), mask);
|
||||||
if (wd < 0) {
|
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);
|
close(fd);
|
||||||
return wd;
|
return wd;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user