summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorSimon Rettberg2017-10-31 23:21:30 +0100
committerSimon Rettberg2017-10-31 23:21:30 +0100
commit858fef5c8fc0c1b4c237dc65499756c3664492d8 (patch)
tree9850f2f082f67f1258519d614e1edc5c6a5501d5 /src/shared
parent[SERVER] net.c: Refactoring and renaming (diff)
downloaddnbd3-858fef5c8fc0c1b4c237dc65499756c3664492d8.tar.gz
dnbd3-858fef5c8fc0c1b4c237dc65499756c3664492d8.tar.xz
dnbd3-858fef5c8fc0c1b4c237dc65499756c3664492d8.zip
[*] Mark logadd() as printf-style function, fix errors that it revealed
...there were quite a few format string errors as it turns out :/
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/log.h3
-rw-r--r--src/shared/sockhelper.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/shared/log.h b/src/shared/log.h
index f273cab..74b3511 100644
--- a/src/shared/log.h
+++ b/src/shared/log.h
@@ -45,7 +45,8 @@ bool log_openLogFile(const char *path);
/**
* Add a line to the log
*/
-void logadd(const logmask_t mask, const char *text, ...);
+void logadd(const logmask_t mask, const char *text, ...)
+ __attribute__ ((format (printf, 2, 3)));
/**
* Return last size bytes of log.
diff --git a/src/shared/sockhelper.c b/src/shared/sockhelper.c
index 6fc7f46..1e34462 100644
--- a/src/shared/sockhelper.c
+++ b/src/shared/sockhelper.c
@@ -235,7 +235,7 @@ bool sock_listen(poll_list_t* list, char* bind_addr, uint16_t port)
continue;
}
if ( listen( sock, 20 ) == -1 ) {
- logadd( LOG_WARNING, "(Bind to %s): cannot listen(), errno=%d", errno );
+ logadd( LOG_WARNING, "(Bind to %s): cannot listen(), errno=%d", bla, errno );
close( sock );
continue;
}