Code Review
/
src
/
app-framework-main.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix labelling of files of widgets
[src/app-framework-main.git]
/
src
/
wgtpkg-install.c
diff --git
a/src/wgtpkg-install.c
b/src/wgtpkg-install.c
index
9c148c7
..
14d3b85
100644
(file)
--- a/
src/wgtpkg-install.c
+++ b/
src/wgtpkg-install.c
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2015-20
19
IoT.bzh
+ Copyright (C) 2015-20
20
IoT.bzh
author: José Bollo <jose.bollo@iot.bzh>
author: José Bollo <jose.bollo@iot.bzh>
@@
-53,7
+53,7
@@
static const char* exec_type_strings[] = {
};
static const char key_afm_prefix[] = "X-AFM-";
};
static const char key_afm_prefix[] = "X-AFM-";
-static const char key_afid[] = "
-
ID";
+static const char key_afid[] = "ID";
#define HTTP_PORT_BASE 30000
#define HTTP_PORT_BASE 30000
@@
-62,8
+62,8
@@
static const char key_afid[] = "-ID";
#define AFID_IS_VALID(afid) (AFID_MIN <= (afid) && (afid) <= AFID_MAX)
#define AFID_COUNT (AFID_MAX - AFID_MIN + 1)
#define AFID_ACNT ((AFID_COUNT + 31) >> 5)
#define AFID_IS_VALID(afid) (AFID_MIN <= (afid) && (afid) <= AFID_MAX)
#define AFID_COUNT (AFID_MAX - AFID_MIN + 1)
#define AFID_ACNT ((AFID_COUNT + 31) >> 5)
-#define AFID_ASFT(afid) (((afid) - AFID_MIN) & 31)
-#define AFID_AIDX(afid) (((afid) - AFID_MIN) >> 5)
+#define AFID_ASFT(afid)
(((afid) - AFID_MIN) & 31)
+#define AFID_AIDX(afid)
(((afid) - AFID_MIN) >> 5)
#define AFID_TEST(array,afid) ((((array)[AFID_AIDX(afid)]) >> AFID_ASFT(afid)) & 1)
#define AFID_SET(array,afid) (((array)[AFID_AIDX(afid)]) |= (((uint32_t)1) << AFID_ASFT(afid)))
#define AFID_TEST(array,afid) ((((array)[AFID_AIDX(afid)]) >> AFID_ASFT(afid)) & 1)
#define AFID_SET(array,afid) (((array)[AFID_AIDX(afid)]) |= (((uint32_t)1) << AFID_ASFT(afid)))
@@
-186,6
+186,12
@@
static int get_new_afid()
/* allocates the afid */
afid = first_free_afid(afids_array);
/* allocates the afid */
afid = first_free_afid(afids_array);
+ if (afid < 0 && errno == EADDRNOTAVAIL) {
+ /* no more ids, try to rescan */
+ memset(afids_array, 0, AFID_ACNT * sizeof(uint32_t));
+ if (update_afids(afids_array) >= 0)
+ afid = first_free_afid(afids_array);
+ }
if (afid >= 0)
AFID_SET(afids_array, afid);
if (afid >= 0)
AFID_SET(afids_array, afid);
@@
-518,7
+524,7
@@
static int install_security(const struct wgt_desc *desc)
if (lf <= lic && icon && !memcmp(f->name, icon, lf) && (!f->name[lf] || f->name[lf] == '/'))
rc = secmgr_path_public_read_only(path);
else
if (lf <= lic && icon && !memcmp(f->name, icon, lf) && (!f->name[lf] || f->name[lf] == '/'))
rc = secmgr_path_public_read_only(path);
else
- rc = secmgr_path_
read_only
(path);
+ rc = secmgr_path_
private
(path);
if (rc)
goto error2;
}
if (rc)
goto error2;
}