From 0ab26ce5ae6c80313e55e3251cc0ee180419f696 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Fri, 26 Feb 2016 16:07:33 +0100 Subject: build: Allow at most 5 errors per build This will show more interesting output when building in Semaphore. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 99750b00..3f210b2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,7 @@ test_and_set_c_compiler_flag_global(-std=c89) test_and_set_c_compiler_flag_global(-Wall) test_and_set_c_compiler_flag_global(-Werror) test_and_set_c_compiler_flag_global(-Wundef) -test_and_set_c_compiler_flag_global(-fmax-errors=1) +test_and_set_c_compiler_flag_global(-fmax-errors=5) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/ouroboros.pc.in" -- cgit v1.2.3 From f02e1f68905a563e1d73a298e0de0e5da8b2eb9f Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Fri, 26 Feb 2016 16:08:09 +0100 Subject: lib: Fix two errors Fixes two errors in the library. The return code of a write to a socket was ignored. A non literal string was passed to sprintf as a literal one. --- src/lib/irm.c | 10 +++++++--- src/lib/sockets.c | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lib/irm.c b/src/lib/irm.c index 2c9b530c..69a98039 100644 --- a/src/lib/irm.c +++ b/src/lib/irm.c @@ -46,13 +46,17 @@ int irm_create_ipcp(rina_name_t name, msg.msgs.create_ipcp.ipcp_type = ipcp_type; buf = serialize_irm_msg(&msg); - if (buf == NULL) + if (buf == NULL) { + close(sockfd); return -1; + } - write(sockfd, buf->data, buf->size); + if (write(sockfd, buf->data, buf->size) == -1) { + close(sockfd); + return -1; + } close(sockfd); - return 0; } diff --git a/src/lib/sockets.c b/src/lib/sockets.c index 095c9e5c..0ebad842 100644 --- a/src/lib/sockets.c +++ b/src/lib/sockets.c @@ -45,7 +45,7 @@ int client_socket_open(char * file_name) } serv_addr.sun_family = AF_UNIX; - sprintf(serv_addr.sun_path, file_name); + sprintf(serv_addr.sun_path, "%s", file_name); if (connect(sockfd, (struct sockaddr *) &serv_addr, -- cgit v1.2.3