sd-event,sd-journal: fix error handling of inotify_add_watch_fd()
Fixes a bug in97ef539169and858749f731.
This commit is contained in:
committed by
Luca Boccassi
parent
3f011540fd
commit
d5f24a0ea9
@@ -2415,7 +2415,7 @@ static int inode_data_realize_watch(sd_event *e, struct inode_data *d) {
|
||||
|
||||
wd = inotify_add_watch_fd(d->inotify_data->fd, d->fd, combined_mask);
|
||||
if (wd < 0)
|
||||
return -errno;
|
||||
return wd;
|
||||
|
||||
if (d->wd < 0) {
|
||||
r = hashmap_put(d->inotify_data->wd, INT_TO_PTR(wd), d);
|
||||
|
||||
@@ -1973,7 +1973,7 @@ static void directory_watch(sd_journal *j, Directory *m, int fd, uint32_t mask)
|
||||
|
||||
m->wd = inotify_add_watch_fd(j->inotify_fd, fd, mask);
|
||||
if (m->wd < 0) {
|
||||
log_debug_errno(errno, "Failed to watch journal directory '%s', ignoring: %m", m->path);
|
||||
log_debug_errno(m->wd, "Failed to watch journal directory '%s', ignoring: %m", m->path);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user