On Fri, Dec 28, 2012 at 11:33:00PM +0200, Tuomas Jorma Juhani Räsänen wrote:
> 
> Signed-off-by: Tuomas Jorma Juhani Räsänen <[email protected]>
> ---
>  nbd-server.c |   64 
> ++++++++++++++++++++++++++++++----------------------------
>  1 file changed, 33 insertions(+), 31 deletions(-)
> 
> diff --git a/nbd-server.c b/nbd-server.c
> index ec617a9..3c8dc9d 100644
> --- a/nbd-server.c
> +++ b/nbd-server.c
> @@ -126,16 +126,18 @@ int glob_flags=0;
>  /* Whether we should avoid forking */
>  int dontfork = 0;
>  
> +static void msg(const int priority, const char *const format, ...) {
> +        va_list ap;
> +
> +        va_start(ap, format);
>  /** Logging macros, now nothing goes to syslog unless you say ISSERVER */
>  #ifdef ISSERVER
> -#define msg2(a,b) syslog(a,b)
> -#define msg3(a,b,c) syslog(a,b,c)
> -#define msg4(a,b,c,d) syslog(a,b,c,d)
> +        vsyslog(priority, format, ap);
>  #else
> -#define msg2(a,b) g_message((char*)b)
> -#define msg3(a,b,c) g_message((char*)b,c)
> -#define msg4(a,b,c,d) g_message((char*)b,c,d)
> +        g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, format, ap);
>  #endif
> +        va_end(ap);
> +}

I've applied this too, but after I did so and pushed it I started
thinking that, because it really only calls one function, it might be
better, for now, to use a C99-style variadic macro instead. I've changed
it in that way.

-- 
Copyshops should do vouchers. So that next time some bureaucracy requires you
to mail a form in triplicate, you can mail it just once, add a voucher, and
save on postage.

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
Nbd-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nbd-general

Reply via email to