Skip to content

Commit c52155e

Browse files
committed
misc: Fix some problems codacy detected.
1 parent e0b4916 commit c52155e

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

src/clib-install.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ int main(int argc, char *argv[]) {
414414

415415
clib_cache_init(CLIB_PACKAGE_CACHE_TIME);
416416

417-
clib_package_opts_t install_package_opts;
417+
clib_package_opts_t install_package_opts = {0};
418418
install_package_opts.skip_cache = opts.skip_cache;
419419
install_package_opts.prefix = opts.prefix;
420420
install_package_opts.global = opts.global;

src/clib-update.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,13 @@ int main(int argc, char *argv[]) {
344344
clib_cache_init(CLIB_PACKAGE_CACHE_TIME);
345345

346346
package_opts.skip_cache = 1;
347-
package_opts.prefix = package_opts.prefix;
347+
package_opts.prefix = opts.prefix;
348348
package_opts.global = 0;
349349
package_opts.force = 1;
350-
package_opts.token = package_opts.token;
350+
package_opts.token = opts.token;
351351

352352
#ifdef HAVE_PTHREADS
353-
package_opts.concurrency = package_opts.concurrency;
353+
package_opts.concurrency = opts.concurrency;
354354
#endif
355355

356356
clib_package_set_opts(package_opts);

src/common/clib-package-installer.c

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 0 deletions
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)