diff --git a/CHANGELOG b/CHANGELOG index cbe50c2c57..5861727488 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ v1.2.alpha (XXXX-XX-XX) ----------------------- +* fixed issue #405: 1.2 compile warnings + * fixed issue #333: [debian] Group "arangodb" is not used when starting vie init.d script * added optional parameter 'excludeSystem' to GET /_api/collection diff --git a/lib/BasicsC/logging.c b/lib/BasicsC/logging.c index 983833e429..da4a9c2180 100644 --- a/lib/BasicsC/logging.c +++ b/lib/BasicsC/logging.c @@ -531,6 +531,25 @@ static int GenerateMessage (char* buffer, return m + n; } +//////////////////////////////////////////////////////////////////////////////// +/// @brief write to stderr +//////////////////////////////////////////////////////////////////////////////// + +void writeStderr (char const* line, size_t len) { + ssize_t n; + + while (0 < len) { + n = TRI_WRITE(STDERR_FILENO, line, len); + + if (n <= 0) { + return; + } + + line += n; + len -= n; + } +} + //////////////////////////////////////////////////////////////////////////////// /// @brief outputs a message string to all appenders //////////////////////////////////////////////////////////////////////////////// @@ -541,8 +560,8 @@ static void OutputMessage (TRI_log_level_e level, size_t length, bool copy) { if (! LoggingActive) { - write(STDERR_FILENO, message, length); - write(STDERR_FILENO, "\n", 1); + writeStderr(message, length); + writeStderr("\n", 1); if (! copy) { TRI_FreeString(TRI_CORE_MEM_ZONE, message); @@ -558,8 +577,8 @@ static void OutputMessage (TRI_log_level_e level, TRI_LockSpin(&AppendersLock); if (Appenders._length == 0) { - write(STDERR_FILENO, message, length); - write(STDERR_FILENO, "\n", 1); + writeStderr(message, length); + writeStderr("\n", 1); if (! copy) { TRI_FreeString(TRI_CORE_MEM_ZONE, message);