Reset device fd upon error condition in handle_inotify()
If an error is encountered while adding a new device in inotify handling, make sure the fd is marked invalid (-1). Signed-off-by: Peter Hurley <phurley@charter.net> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
This commit is contained in:
parent
8e433bf584
commit
ea4acf08bc
1 changed files with 1 additions and 0 deletions
1
src/fw.c
1
src/fw.c
|
@ -426,6 +426,7 @@ handle_inotify(raw1394handle_t handle, struct epoll_closure *ec,
|
|||
ep.data.ptr = &fwhandle->devices[i].closure;
|
||||
if (epoll_ctl(fwhandle->epoll_fd, EPOLL_CTL_ADD, fd, &ep) < 0) {
|
||||
close(fd);
|
||||
fwhandle->devices[i].fd = -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue