[Sheepdog] [PATCH] logger: quiet gcc about write()
MORITA Kazutaka
morita.kazutaka at lab.ntt.co.jp
Thu Nov 17 13:55:36 CET 2011
At Thu, 17 Nov 2011 17:58:41 +0800,
Liu Yuan wrote:
>
> From: Liu Yuan <tailai.ly at taobao.com>
>
> use xwrite() instead of write() to get rid of below kindly warning:
>
> logger.c:276: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
>
> Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
> ---
> lib/logger.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
Applied, thanks!
This patch depends on your candy patches, so I've also applied them to
the master branch.
Thanks,
Kazutaka
>
> diff --git a/lib/logger.c b/lib/logger.c
> index cd02892..5be035a 100644
> --- a/lib/logger.c
> +++ b/lib/logger.c
> @@ -30,6 +30,7 @@
> #include <sys/prctl.h>
>
> #include "logger.h"
> +#include "util.h"
>
> #define LOGDBG 0
>
> @@ -273,7 +274,7 @@ static void log_syslog(void * buff)
> struct logmsg * msg = (struct logmsg *)buff;
>
> if (la->fd >= 0)
> - write(la->fd, (char *)&msg->str, strlen((char *)&msg->str));
> + xwrite(la->fd, (char *)&msg->str, strlen((char *)&msg->str));
> else
> syslog(msg->prio, "%s", (char *)&msg->str);
> }
> --
> 1.7.6.1
>
> --
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog
More information about the sheepdog
mailing list