From e6b5d70591904db003f1011e884609f6d95fb22a Mon Sep 17 00:00:00 2001
From: Jakob Olsson <jakobols@kth.se>
Date: Mon, 28 May 2018 08:46:22 +0200
Subject: [PATCH] small fixes

---
 dongle.c                | 2 +-
 dongle_infrastructure.c | 7 +++----
 dongle_infrastructure.h | 4 ++--
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/dongle.c b/dongle.c
index 45aebbb..a4b238a 100644
--- a/dongle.c
+++ b/dongle.c
@@ -8,7 +8,7 @@
 
 struct ubus_context *ctx;
 int debug;
-struct uloop_timeout timeout = { .cb = status };
+struct uloop_timeout timeout = { .cb = devices_status };
 
 static struct option long_options[] = {
 	{"debug", required_argument, NULL, 'd'},
diff --git a/dongle_infrastructure.c b/dongle_infrastructure.c
index 78fc8d1..4508b3e 100644
--- a/dongle_infrastructure.c
+++ b/dongle_infrastructure.c
@@ -58,10 +58,9 @@ int add_device(char *name, char *ip)
 {
 	struct device *dev;
 
-	/* Either do this here, or send an ENUM {FIND, FIND_INCREMENT} flag to search? */
 	dev = search_list(name);
 	if (dev) {
-		dev->current_pass = true;
+		dev->present = true;
 		goto fail;
 	}
 	dev = malloc(sizeof(struct device));
@@ -71,7 +70,7 @@ int add_device(char *name, char *ip)
 		goto fail;
 	}
 
-	dev->current_pass = true;
+	dev->present = true;
 	dev->name = name;
 	dev->ip = ip;
 	list_add(&dev->list, &devices);
@@ -188,7 +187,7 @@ int get_devices(void)
 		}
 
 		while ((de = readdir(dr)) != NULL) {
-			if(strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0)
+			if (strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0)
 				continue;
 
 			if (fstatat(dirfd(dr), de->d_name, &st, 0) < 0) {
diff --git a/dongle_infrastructure.h b/dongle_infrastructure.h
index 3fd022e..e7e2cc1 100644
--- a/dongle_infrastructure.h
+++ b/dongle_infrastructure.h
@@ -12,9 +12,9 @@ struct device {
 
 int expose_infrastructure_object(struct ubus_context *ctx);
 int get_devices(void);
-int status(struct uloop_timeout *t);
+int devices_status(struct uloop_timeout *t);
 char *get_device_ip(char *device_name);
-int find_missing_devices(void);
+int tag_missing_devices(void);
 int add_device(char *name, char *ip);
 int delete_device_by_name(char *name);
 int delete_device_by_obj(struct device *dev);
-- 
GitLab