diff options
Diffstat (limited to 'ext2fs/msg.c')
-rw-r--r-- | ext2fs/msg.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/ext2fs/msg.c b/ext2fs/msg.c index 727d926d..83939b06 100644 --- a/ext2fs/msg.c +++ b/ext2fs/msg.c @@ -23,16 +23,17 @@ #include "ext2fs.h" -struct mutex printf_lock = MUTEX_INITIALIZER; /* XXX */ +pthread_mutex_t printf_lock = PTHREAD_MUTEX_INITIALIZER; /* XXX */ + int printf (const char *fmt, ...) { va_list arg; int done; va_start (arg, fmt); - mutex_lock (&printf_lock); + pthread_mutex_lock (&printf_lock); done = vprintf (fmt, arg); - mutex_unlock (&printf_lock); + pthread_mutex_unlock (&printf_lock); va_end (arg); return done; } @@ -43,7 +44,7 @@ void _ext2_error (const char * function, const char * fmt, ...) { va_list args; - mutex_lock(&printf_lock); + pthread_mutex_lock (&printf_lock); va_start (args, fmt); vsprintf (error_buf, fmt, args); @@ -51,14 +52,14 @@ void _ext2_error (const char * function, const char * fmt, ...) fprintf (stderr, "ext2fs: %s: %s: %s\n", diskfs_disk_name, function, error_buf); - mutex_unlock(&printf_lock); + pthread_mutex_unlock (&printf_lock); } void _ext2_panic (const char * function, const char * fmt, ...) { va_list args; - mutex_lock(&printf_lock); + pthread_mutex_lock (&printf_lock); va_start (args, fmt); vsprintf (error_buf, fmt, args); @@ -67,7 +68,7 @@ void _ext2_panic (const char * function, const char * fmt, ...) fprintf(stderr, "ext2fs: %s: panic: %s: %s\n", diskfs_disk_name, function, error_buf); - mutex_unlock(&printf_lock); + pthread_mutex_unlock (&printf_lock); exit (1); } @@ -76,7 +77,7 @@ void ext2_warning (const char * fmt, ...) { va_list args; - mutex_lock(&printf_lock); + pthread_mutex_lock (&printf_lock); va_start (args, fmt); vsprintf (error_buf, fmt, args); @@ -84,5 +85,5 @@ void ext2_warning (const char * fmt, ...) fprintf (stderr, "ext2fs: %s: warning: %s\n", diskfs_disk_name, error_buf); - mutex_unlock(&printf_lock); + pthread_mutex_unlock (&printf_lock); } |