On Wednesday 16 March 2016 20:51:12 Andrew Lunn wrote:
--- a/batadv_query.c
+++ b/batadv_query.c
@@ -90,16 +90,9 @@ int ipv6_to_mac(const struct in6_addr *addr, struct ether_addr *mac)
int batadv_interface_check(const char *mesh_iface)
{
- char *debugfs_mnt;
char full_path[MAX_PATH + 1];
FILE *f;
- debugfs_mnt = debugfs_mount(NULL);
- if (!debugfs_mnt) {
- fprintf(stderr, "Could not find debugfs path\n");
- return -1;
- }
-
[...]
diff --git a/main.c b/main.c
index 9610398..52dca97 100644
--- a/main.c
+++ b/main.c
[...]
@@ -160,6 +161,9 @@ static struct globals
*alfred_init(int argc, char *argv[])
{NULL, 0, NULL, 0},
};
+ /* We need full capabilities to mount debugfs, so do that now */
+ debugfs_mount(NULL);
+
ret = reduce_capabilities();
if (ret < 0)
return NULL;
There were some return value checks for the debugfs_mount calls which you've
removed. Why isn't here some kind of check with error handling/warning, ...?
Kind regards,
Sven