filesetup: create zbd_info before jumping to done label
[fio.git] / log.c
diff --git a/log.c b/log.c
index 7e8b13b31a84c906a09db6fce5044ef8e051fcae..237bac28899c9feaf603835040732d0901d1acbf 100644 (file)
--- a/log.c
+++ b/log.c
@@ -1,5 +1,4 @@
 #include <unistd.h>
-#include <fcntl.h>
 #include <string.h>
 #include <stdarg.h>
 #include <syslog.h>
@@ -16,7 +15,7 @@ size_t log_info_buf(const char *buf, size_t len)
                return 0;
 
        if (is_backend) {
-               size_t ret = fio_server_text_output(FIO_LOG_INFO, buf, len);
+               ssize_t ret = fio_server_text_output(FIO_LOG_INFO, buf, len);
                if (ret != -1)
                        return ret;
        }
@@ -43,6 +42,7 @@ size_t log_valist(const char *fmt, va_list args)
 }
 
 /* add prefix for the specified type in front of the valist */
+#ifdef FIO_INC_DEBUG
 void log_prevalist(int type, const char *fmt, va_list args)
 {
        char *buf1, *buf2;
@@ -62,14 +62,15 @@ void log_prevalist(int type, const char *fmt, va_list args)
        free(buf1);
        if (len < 0)
                return;
-       len = log_info_buf(buf2, len);
+       log_info_buf(buf2, len);
        free(buf2);
 }
+#endif
 
-size_t log_info(const char *format, ...)
+ssize_t log_info(const char *format, ...)
 {
        va_list args;
-       size_t ret;
+       ssize_t ret;
 
        va_start(args, format);
        ret = log_valist(format, args);
@@ -103,9 +104,9 @@ int log_info_flush(void)
        return fflush(f_out);
 }
 
-size_t log_err(const char *format, ...)
+ssize_t log_err(const char *format, ...)
 {
-       size_t ret;
+       ssize_t ret;
        int len;
        char *buffer;
        va_list args;