Skip to content

Commit 8adc255

Browse files
committed
misc: Fix some problems codacy detected.
1 parent a5adbcf commit 8adc255

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

src/clib-install.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ int main(int argc, char *argv[]) {
421421

422422
clib_cache_init(CLIB_PACKAGE_CACHE_TIME);
423423

424-
clib_package_opts_t install_package_opts;
424+
clib_package_opts_t install_package_opts = {0};
425425
install_package_opts.skip_cache = opts.skip_cache;
426426
install_package_opts.prefix = opts.prefix;
427427
install_package_opts.global = opts.global;

src/clib-update.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -351,13 +351,13 @@ int main(int argc, char *argv[]) {
351351
clib_cache_init(CLIB_PACKAGE_CACHE_TIME);
352352

353353
package_opts.skip_cache = 1;
354-
package_opts.prefix = package_opts.prefix;
354+
package_opts.prefix = opts.prefix;
355355
package_opts.global = 0;
356356
package_opts.force = 1;
357-
package_opts.token = package_opts.token;
357+
package_opts.token = opts.token;
358358

359359
#ifdef HAVE_PTHREADS
360-
package_opts.concurrency = package_opts.concurrency;
360+
package_opts.concurrency = opts.concurrency;
361361
#endif
362362

363363
clib_package_set_opts(package_opts);

src/common/clib-package-installer.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,8 @@ int clib_package_install(clib_package_t *pkg, const char *dir, int verbose) {
507507
}
508508

509509
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
510-
usleep(1024 * 10);
510+
struct timespec ts = {0, 1000*1000*10};
511+
nanosleep(&ts, NULL);
511512
#endif
512513

513514
#ifdef HAVE_PTHREADS

src/registry/registry.c

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ registry_ptr_t registry_create(const char *url, const char *secret) {
6262
} else if (strstr(url, "gitlab") != NULL) {
6363
registry->type = REGISTRY_TYPE_GITLAB;
6464
} else {
65+
registry_free(registry);
66+
6567
return NULL;
6668
}
6769

0 commit comments

Comments
 (0)