diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 052b0db7..155bb128 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,7 @@ stages: variables: BUILD_IMAGES_PROJECT: openconnect/build-images + ALPINE_BUILD: buildenv-alpine DEBIAN_BUILD: buildenv-debian FEDORA_BUILD: buildenv-fedora UBUNTU16_BUILD: buildenv-ubuntu @@ -230,6 +231,24 @@ Coverity: paths: - cov-int/*.txt +# Test building with musl +musl/Alpine: + stage: testing + image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$ALPINE_BUILD + script: + - autoreconf -fvi + - ./configure --disable-maintainer-mode --without-docker-tests --with-werror + - make -j$JOBS + tags: + - shared + - linux + except: + - tags + artifacts: + expire_in: 1 day + untracked: true + when: on_failure + Fedora: stage: testing image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD @@ -255,7 +274,7 @@ Fedora: untracked: true when: always -Fedora-noprocfs: +noprocfs/Fedora: stage: testing image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD script: diff --git a/src/icmp-ping.c b/src/icmp-ping.c index 7aed967d..58adef5a 100644 --- a/src/icmp-ping.c +++ b/src/icmp-ping.c @@ -200,9 +200,9 @@ int icmp_ping4(main_server_st * s, struct sockaddr_in *addr1) pkt->icmp_cksum = in_cksum((unsigned short *) pkt, sizeof(packet1)); - while ((c = sendto(pingsock, packet1, DEFDATALEN + ICMP_MINLEN, 0, - (struct sockaddr *) addr1, - sizeof(*addr1)) == -1) && retry(errno)); + while (sendto(pingsock, packet1, DEFDATALEN + ICMP_MINLEN, 0, + (struct sockaddr *) addr1, + sizeof(*addr1) == -1) && retry(errno)); /* listen for replies */ now = time(0); @@ -294,11 +294,10 @@ int icmp_ping6(main_server_st * s, setsockopt(pingsock, SOL_RAW, IPV6_CHECKSUM, &sockopt, sizeof(sockopt)); #endif - while ((c = - sendto(pingsock, packet1, - DEFDATALEN + sizeof(struct icmp6_hdr), 0, - (struct sockaddr *) addr1, - sizeof(*addr1)) == -1) && retry(errno)); + while (sendto(pingsock, packet1, + DEFDATALEN + sizeof(struct icmp6_hdr), 0, + (struct sockaddr *) addr1, + sizeof(*addr1) == -1) && retry(errno)); /* listen for replies */ now = time(0); diff --git a/src/occtl/nl.c b/src/occtl/nl.c index 615e12e6..2f5197ca 100644 --- a/src/occtl/nl.c +++ b/src/occtl/nl.c @@ -53,7 +53,7 @@ int err; } if ((err = nl_connect(sock, NETLINK_ROUTE)) < 0) { - fprintf(stderr, "nl: error in nl_connect"); + fprintf(stderr, "nl: error in nl_connect (%d)", err); goto error; } diff --git a/src/occtl/occtl.c b/src/occtl/occtl.c index 7d18771c..2793c640 100644 --- a/src/occtl/occtl.c +++ b/src/occtl/occtl.c @@ -286,7 +286,7 @@ unsigned check_cmd(const char *cmd, const char *input, { char *t, *p; unsigned len, tlen; - unsigned i, j, ret = 0; + unsigned i, ret = 0; char prev; while (whitespace(*input)) @@ -300,7 +300,7 @@ unsigned check_cmd(const char *cmd, const char *input, prev = 0; p = t; - for (i = j = 0; i < len; i++) { + for (i = 0; i < len; i++) { if (!whitespace(prev) || !whitespace(input[i])) { *p = input[i]; prev = input[i]; diff --git a/src/occtl/unix.c b/src/occtl/unix.c index a7877a20..6bf17eb0 100644 --- a/src/occtl/unix.c +++ b/src/occtl/unix.c @@ -1210,7 +1210,7 @@ int common_info_cmd(UserListRep * args, FILE *out, cmd_params_st *params) print_single_value(out, params, "Routes", "defaultroute", 1); } - if ((r = print_list_entries(out, params, "No-routes", args->user[i]->no_routes, args->user[i]->n_no_routes, 1)) < 0) + if (print_list_entries(out, params, "No-routes", args->user[i]->no_routes, args->user[i]->n_no_routes, 1) < 0) goto error_parse; if (print_list_entries(out, params, "iRoutes", args->user[i]->iroutes, args->user[i]->n_iroutes, 1) < 0) diff --git a/src/worker-privs.c b/src/worker-privs.c index 6640b5ae..e01be0ab 100644 --- a/src/worker-privs.c +++ b/src/worker-privs.c @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include /* libseccomp 2.4.2 broke accidentally the API. Work around it. */