Skip to content
Snippets Groups Projects
Commit a442de61 authored by Amin Ben Ramdhane's avatar Amin Ben Ramdhane
Browse files

swmod: enhancement

parent 38744aa7
Branches
No related tags found
No related merge requests found
...@@ -590,15 +590,15 @@ swmod_eu_list(struct ubus_context *ctx, struct ubus_object *obj, ...@@ -590,15 +590,15 @@ swmod_eu_list(struct ubus_context *ctx, struct ubus_object *obj,
return 0; return 0;
} }
static struct ubus_method swmod_object_methods[] = { static const struct ubus_method swmod_object_methods[] = {
UBUS_METHOD_NOARG("environment", swmod_environment), UBUS_METHOD_NOARG("environment", swmod_environment),
UBUS_METHOD_NOARG("du_list", swmod_du_list),
UBUS_METHOD_NOARG("eu_list", swmod_eu_list),
UBUS_METHOD("install", swmod_install, install_policy), UBUS_METHOD("install", swmod_install, install_policy),
UBUS_METHOD("remove", swmod_remove, remove_policy), UBUS_METHOD("remove", swmod_remove, remove_policy),
UBUS_METHOD("du_install", swmod_du_install, du_install_policy), UBUS_METHOD("du_install", swmod_du_install, du_install_policy),
UBUS_METHOD("du_update", swmod_du_update, du_update_policy), UBUS_METHOD("du_update", swmod_du_update, du_update_policy),
UBUS_METHOD("du_uninstall", swmod_du_uninstall, du_uninstall_policy), UBUS_METHOD("du_uninstall", swmod_du_uninstall, du_uninstall_policy),
UBUS_METHOD_NOARG("du_list", swmod_du_list),
UBUS_METHOD_NOARG("eu_list", swmod_eu_list)
}; };
static struct ubus_object_type swmod_object_type = UBUS_OBJECT_TYPE("swmodules", swmod_object_methods); static struct ubus_object_type swmod_object_type = UBUS_OBJECT_TYPE("swmodules", swmod_object_methods);
......
...@@ -75,7 +75,7 @@ static int swmod_host_system_install_remove_package(const char *package_path, in ...@@ -75,7 +75,7 @@ static int swmod_host_system_install_remove_package(const char *package_path, in
int swmod_install_remove_package(const char *package_path, const char *environment, int action) int swmod_install_remove_package(const char *package_path, const char *environment, int action)
{ {
if (environment && (strcmp(environment, HOST_SYSTEM) != 0)) if (environment && *environment != '\0' && (strcmp(environment, HOST_SYSTEM) != 0))
return swmod_lxc_install_remove_package(package_path, environment, action); return swmod_lxc_install_remove_package(package_path, environment, action);
return swmod_host_system_install_remove_package(package_path, action); return swmod_host_system_install_remove_package(package_path, action);
......
...@@ -69,7 +69,7 @@ void swmod_strncpy(char *dst, const char *src, size_t n) ...@@ -69,7 +69,7 @@ void swmod_strncpy(char *dst, const char *src, size_t n)
char *generate_full_url(char *url, char *username, char *password) char *generate_full_url(char *url, char *username, char *password)
{ {
if (!username && !password) if ((!username && !password) || *username == '\0' || *password == '\0')
return url; return url;
static char buf[512]= {0}; static char buf[512]= {0};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment