From 866d908b6d4dcb6ad57d3bb0497f7f7d831d9628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 29 May 2017 06:47:40 +0200 Subject: [PATCH] qubesd-query-fast: fix compile warnings, enable -Werror --- qubes-rpc/Makefile | 2 +- qubes-rpc/qubesd-query-fast.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qubes-rpc/Makefile b/qubes-rpc/Makefile index 1ae2e1d2..07c1364a 100644 --- a/qubes-rpc/Makefile +++ b/qubes-rpc/Makefile @@ -1,4 +1,4 @@ -CFLAGS=-O3 +CFLAGS=-O2 -g -Wall -Werror -Wextra all: qubesd-query-fast diff --git a/qubes-rpc/qubesd-query-fast.c b/qubes-rpc/qubesd-query-fast.c index 2c083598..7505fc23 100644 --- a/qubes-rpc/qubesd-query-fast.c +++ b/qubes-rpc/qubesd-query-fast.c @@ -8,7 +8,7 @@ #define QUBESD_SOCKET "/var/run/qubesd.sock" void write_wrapper(int fd, char *data, size_t len) { - int written = 0; + size_t written = 0; int ret; while (written < len) { ret = write(fd, data+written, len-written); @@ -36,7 +36,7 @@ int main(int argc, char **argv) { service_name++; if (!source_domain || !target_domain || !service_name || argc > 2) { - fprintf(stderr, "Usage: %s [service-argument]\n"); + fprintf(stderr, "Usage: %s [service-argument]\n", argv[0]); fprintf(stderr, "\n"); fprintf(stderr, "Expected environment variables:\n"); fprintf(stderr, " - QREXEC_REMOTE_DOMAIN - source domain for the call\n");