Skip to content

Commit

Permalink
set vnode_fd = -1 on close
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Feb 28, 2018
1 parent 8d274a1 commit 43b2c6b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/modules/proto_detail/proto_detail_file.c
Expand Up @@ -392,9 +392,12 @@ static int work_exists(proto_detail_file_t *inst, int fd)

if (!fr_schedule_socket_add(inst->parent->sc, listen)) {
error:
if ((inst->vnode_fd >= 0) &&
(fr_event_fd_delete(inst->el, inst->vnode_fd, FR_EVENT_FILTER_VNODE) < 0)) {
PERROR("Failed removing DELETE callback when opening work file");
if (inst->vnode_fd >= 0) {
if (fr_event_fd_delete(inst->el, inst->vnode_fd, FR_EVENT_FILTER_VNODE) < 0) {
PERROR("Failed removing DELETE callback when opening work file");
}
close(inst->vnode_fd);
inst->vnode_fd = -1;
}

if (opened) {
Expand Down

0 comments on commit 43b2c6b

Please sign in to comment.