aboutsummaryrefslogtreecommitdiffstats
path: root/src/wgtpkg-install.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2015-12-22 19:14:53 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2015-12-22 19:14:53 +0100
commita8f72186c447ba9b917c7f24a00497ae36dbc71f (patch)
tree46368c4333aba36cf6c1c5e4e52127826de2a7d0 /src/wgtpkg-install.c
parentce714369c64051d5307ef7ac9af2c53b6edfbb4a (diff)
implementation of installation by the daemon
Change-Id: I50ceca8c515df5a22f3387ccd1a6e3716641661f
Diffstat (limited to 'src/wgtpkg-install.c')
-rw-r--r--src/wgtpkg-install.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/wgtpkg-install.c b/src/wgtpkg-install.c
index 933e612..70198e9 100644
--- a/src/wgtpkg-install.c
+++ b/src/wgtpkg-install.c
@@ -28,6 +28,7 @@
#include "wgtpkg.h"
#include "wgt.h"
#include "wgt-info.h"
+#include "wgtpkg-install.h"
#include "secmgr-wrap.h"
#include "utils-dir.h"
@@ -216,7 +217,7 @@ error:
}
/* install the widget of the file */
-int install_widget(const char *wgtfile, const char *root, int force)
+struct wgt_info *install_widget(const char *wgtfile, const char *root, int force)
{
struct wgt_info *ifo;
const struct wgt_desc *desc;
@@ -253,7 +254,8 @@ int install_widget(const char *wgtfile, const char *root, int force)
if (install_security(desc))
goto error3;
- return 0;
+ file_reset();
+ return ifo;
error3:
wgt_info_unref(ifo);
@@ -262,6 +264,7 @@ error2:
remove_workdir();
error1:
- return -1;
+ file_reset();
+ return NULL;
}