crda: close fd upon leaving
authorLuis R. Rodriguez <mcgrof@frijolero.org>
Thu, 19 Jan 2012 00:21:51 +0000 (16:21 -0800)
committerLuis R. Rodriguez <mcgrof@frijolero.org>
Thu, 19 Jan 2012 01:51:24 +0000 (17:51 -0800)
This was never done. Do this at the end for now but soon
this will be changed in preference for the file opening
only to be done by crda for checking which file to use
to pass on to reglib for usage.

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
crda.c

diff --git a/crda.c b/crda.c
index 1db54a5..5a1cd83 100644 (file)
--- a/crda.c
+++ b/crda.c
@@ -10,6 +10,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <arpa/inet.h>
+#include <unistd.h>
 
 #include <netlink/genl/genl.h>
 #include <netlink/genl/family.h>
@@ -333,5 +334,7 @@ nla_put_failure:
        nlmsg_free(msg);
 out:
        nl80211_cleanup(&nlstate);
+       close(fd);
+
        return r;
 }