From 17769cf1af093dfb4b9bc3347ae39324029989ac Mon Sep 17 00:00:00 2001 From: John Levon Date: Wed, 22 Dec 2021 10:17:11 +0000 Subject: fix coverity issues (#636) Fix three remaining low priority coverity issues; they do not represent bugs. Signed-off-by: John Levon Reviewed-by: Swapnil Ingle --- samples/client.c | 2 ++ samples/server.c | 3 +++ 2 files changed, 5 insertions(+) (limited to 'samples') diff --git a/samples/client.c b/samples/client.c index 6cd065d..9f90401 100644 --- a/samples/client.c +++ b/samples/client.c @@ -1162,6 +1162,8 @@ int main(int argc, char *argv[]) */ nr_dma_regions = server_max_fds << 1; + umask(0022); + if ((tmpfd = mkstemp(template)) == -1) { err(EXIT_FAILURE, "failed to create backing file"); } diff --git a/samples/server.c b/samples/server.c index a43dc3c..25b4908 100644 --- a/samples/server.c +++ b/samples/server.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include "common.h" @@ -483,6 +484,8 @@ int main(int argc, char *argv[]) err(EXIT_FAILURE, "failed to setup BAR0 region"); } + umask(0022); + /* * Setup BAR1 to be 3 pages in size where only the first and the last pages * are mappable. The client can still mmap the 2nd page, we can't prohibit -- cgit v1.1