qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [patch 02/10] qemu: mutex/thread/cond wrappers


From: malc
Subject: Re: [Qemu-devel] [patch 02/10] qemu: mutex/thread/cond wrappers
Date: Thu, 26 Mar 2009 14:01:06 +0300 (MSK)

On Wed, 25 Mar 2009, Marcelo Tosatti wrote:

> Signed-off-by: Marcelo Tosatti <address@hidden>
> 
> Index: trunk/qemu-thread.c
> ===================================================================
> --- /dev/null
> +++ trunk/qemu-thread.c
> @@ -0,0 +1,123 @@
> +#include <stdlib.h>
> +#include <stdio.h>
> +#include <errno.h>
> +#include <time.h>
> +#include <signal.h>
> +#include <stdint.h>
> +#include "qemu-thread.h"
> +
> +static void error_exit(const char *msg)
> +{
> +    perror(msg);
> +    exit(1);
> +}
> +
> +void qemu_mutex_init(QemuMutex *mutex)
> +{
> +    if (pthread_mutex_init(&mutex->lock, NULL))
> +        error_exit(__func__);
> +}

This is wrong, pthread functions return the error code and do not
set the errno thus using perror is meaningless.

[..snip..]

-- 
mailto:address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]