aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Hurley <phurley@charter.net>2010-10-27 09:28:24 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2012-02-05 10:32:44 +0100
commitea4acf08bc71872215be84deabfb42b9133660ab (patch)
treed564bacaeb5465955409b3b21bb364d08cc19ba2
parent8e433bf58413725365654c27fb4fad0aad88b516 (diff)
downloadlibraw1394-ea4acf08bc71872215be84deabfb42b9133660ab.tar.gz
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>
-rw-r--r--src/fw.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/fw.c b/src/fw.c
index cfaab13..2d8a292 100644
--- a/src/fw.c
+++ b/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;
}