Skip to content

Commit

Permalink
misc: Fix some problems codacy detected.
Browse files Browse the repository at this point in the history
  • Loading branch information
nouwaarom committed Mar 26, 2021
1 parent a5adbcf commit 8adc255
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/clib-install.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ int main(int argc, char *argv[]) {

clib_cache_init(CLIB_PACKAGE_CACHE_TIME);

clib_package_opts_t install_package_opts;
clib_package_opts_t install_package_opts = {0};
install_package_opts.skip_cache = opts.skip_cache;
install_package_opts.prefix = opts.prefix;
install_package_opts.global = opts.global;
Expand Down
6 changes: 3 additions & 3 deletions src/clib-update.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,13 @@ int main(int argc, char *argv[]) {
clib_cache_init(CLIB_PACKAGE_CACHE_TIME);

package_opts.skip_cache = 1;
package_opts.prefix = package_opts.prefix;
package_opts.prefix = opts.prefix;
package_opts.global = 0;
package_opts.force = 1;
package_opts.token = package_opts.token;
package_opts.token = opts.token;

#ifdef HAVE_PTHREADS
package_opts.concurrency = package_opts.concurrency;
package_opts.concurrency = opts.concurrency;
#endif

clib_package_set_opts(package_opts);
Expand Down
3 changes: 2 additions & 1 deletion src/common/clib-package-installer.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,8 @@ int clib_package_install(clib_package_t *pkg, const char *dir, int verbose) {
}

#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
usleep(1024 * 10);
struct timespec ts = {0, 1000*1000*10};
nanosleep(&ts, NULL);
#endif

#ifdef HAVE_PTHREADS
Expand Down
2 changes: 2 additions & 0 deletions src/registry/registry.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ registry_ptr_t registry_create(const char *url, const char *secret) {
} else if (strstr(url, "gitlab") != NULL) {
registry->type = REGISTRY_TYPE_GITLAB;
} else {
registry_free(registry);

return NULL;
}

Expand Down

0 comments on commit 8adc255

Please sign in to comment.