aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-10-10 17:09:14 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-11-24 17:44:57 +0100
commit88c29cb013f933cdf9027226d599c706b26dcf3e (patch)
treedb7b2c708139aa8010988d4eadb85356b67ae825
parente1e93274a24cdd1aa3b8849fdff6385d5221137c (diff)
afm-udb: keep looking at valid units
Returning an error when a unit is not valid has drawbacks. With this commit, bogus units are ignored. The benefit is to be able of using valid units instead of using none because in the previous case, all the DB was cancelled. Change-Id: Id1e4d6d5efd4af7e118b9d549238bd5e3d6c52d7 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/afm-udb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/afm-udb.c b/src/afm-udb.c
index 0a48810..80cc715 100644
--- a/src/afm-udb.c
+++ b/src/afm-udb.c
@@ -34,7 +34,6 @@
#include "afm-udb.h"
-
static const char x_afm_prefix[] = "X-AFM-";
static const char service_extension[] = ".service";
static const char key_unit_path[] = "-unit-path";
@@ -367,12 +366,14 @@ static int update_cb(void *closure, const char *name, const char *path, int isus
/* reads the file */
rc = read_unit_file(path, &content, &length);
if (rc < 0)
- return rc;
+ return 0;
/* process the file */
rc = addunit(&updt->applications, isuser, path, name, content, length);
+ /* TODO: if (rc < 0)
+ ERROR("Ignored boggus unit %s (error: %m)", path); */
free(content);
- return rc;
+ return 0;
}
/*