Fix broken error checking around pthread functions

This commit is contained in:
Alex Young
2012-06-11 16:08:19 +01:00
parent 5996c8f7ba
commit 2a71b4e7a4
4 changed files with 10 additions and 9 deletions

View File

@@ -112,11 +112,11 @@ void server_dirty(struct server *serve, off64_t from, int len)
}
#define SERVER_LOCK( s, f, msg ) \
{ NULLCHECK( s ); \
FATAL_IF_NEGATIVE( pthread_mutex_lock( &s->f ), msg ); }
do { NULLCHECK( s ); \
FATAL_IF( 0 != pthread_mutex_lock( &s->f ), msg ); } while (0)
#define SERVER_UNLOCK( s, f, msg ) \
{ NULLCHECK( s ); \
FATAL_IF_NEGATIVE( pthread_mutex_unlock( &s->f ), msg ); }
do { NULLCHECK( s ); \
FATAL_IF( 0 != pthread_mutex_unlock( &s->f ), msg ); } while (0)
void server_lock_io( struct server * serve)
{