diff options
author | José Bollo <jose.bollo@iot.bzh> | 2018-12-18 10:58:25 +0100 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2018-12-18 11:04:53 +0100 |
commit | f8b04951b4ccafdf28b875825edd46316fafb519 (patch) | |
tree | e86e965cd77f375fa1aee9858b56f34e7682a441 /src/wgtpkg-install.c | |
parent | a8ffd5216cf61aa3dbf97d442e0e3184763d773f (diff) |
afm-unit: Fix http port multi allocation
When serveral targets were set in the widget file, the
framework allocated the same HTTP port to each. This
lead to impossibility to run all targets or to a
systemd conflict.
This should fix the issue by allocating an HTTP port for
each target installed by the widget. To achieves that goal,
the afm-unit.conf tag for the port is moved from
'#metadata.http-port' to '#metatarget.http-port'.
Bug-AGL: SPEC-2068
Change-Id: I5376d6f052e0ffc5c77cc80041528637777aed1e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/wgtpkg-install.c')
-rw-r--r-- | src/wgtpkg-install.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/wgtpkg-install.c b/src/wgtpkg-install.c index c5c41ea..8d59b37 100644 --- a/src/wgtpkg-install.c +++ b/src/wgtpkg-install.c @@ -541,7 +541,7 @@ struct wgt_info *install_widget(const char *wgtfile, const char *root, int force struct wgt_info *ifo; const struct wgt_desc *desc; char installdir[PATH_MAX]; - int port, err; + int err; struct unitconf uconf; NOTICE("-- INSTALLING widget %s to %s --", wgtfile, root); @@ -596,13 +596,9 @@ struct wgt_info *install_widget(const char *wgtfile, const char *root, int force if (install_file_properties(desc)) goto error4; - port = get_port(); - if (port < 0) - goto error4; - uconf.installdir = installdir; uconf.icondir = FWK_ICON_DIR; - uconf.port = port; + uconf.port = get_port; if (unit_install(ifo, &uconf)) goto error4; |