From c663dbd90626c1e7389f93b6e4c0814e8efedc20 Mon Sep 17 00:00:00 2001 From: cristy Date: Fri, 16 Sep 2011 19:43:14 +0000 Subject: [PATCH] --- MagickCore/animate.c | 10 ++++++++-- MagickCore/display.c | 20 ++++++++++++++++---- MagickCore/semaphore.c | 11 +++++++++++ 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/MagickCore/animate.c b/MagickCore/animate.c index 97a3df15b..baa6196c2 100644 --- a/MagickCore/animate.c +++ b/MagickCore/animate.c @@ -543,8 +543,14 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info, status=XSaveImage(display,resource_info,windows,*image,exception); if (status == MagickFalse) { - XNoticeWidget(display,windows,"Unable to write X image:", - (*image)->filename); + char + message[MaxTextExtent]; + + (void) FormatLocaleString(message,MaxTextExtent,"%s:%s", + exception->reason != (char *) NULL ? exception->reason : "", + exception->description != (char *) NULL ? exception->description : + ""); + XNoticeWidget(display,windows,"Unable to save file:",message); break; } break; diff --git a/MagickCore/display.c b/MagickCore/display.c index 555cbe699..150fb7a6f 100644 --- a/MagickCore/display.c +++ b/MagickCore/display.c @@ -7209,8 +7209,14 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info, status=XSaveImage(display,resource_info,windows,*image,exception); if (status == MagickFalse) { - XNoticeWidget(display,windows,"Unable to write X image:", - (*image)->filename); + char + message[MaxTextExtent]; + + (void) FormatLocaleString(message,MaxTextExtent,"%s:%s", + exception->reason != (char *) NULL ? exception->reason : "", + exception->description != (char *) NULL ? exception->description : + ""); + XNoticeWidget(display,windows,"Unable to save file:",message); break; } break; @@ -7223,8 +7229,14 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info, status=XPrintImage(display,resource_info,windows,*image,exception); if (status == MagickFalse) { - XNoticeWidget(display,windows,"Unable to print X image:", - (*image)->filename); + char + message[MaxTextExtent]; + + (void) FormatLocaleString(message,MaxTextExtent,"%s:%s", + exception->reason != (char *) NULL ? exception->reason : "", + exception->description != (char *) NULL ? exception->description : + ""); + XNoticeWidget(display,windows,"Unable to print file:",message); break; } break; diff --git a/MagickCore/semaphore.c b/MagickCore/semaphore.c index 6e57f4ff3..b39e56b5e 100644 --- a/MagickCore/semaphore.c +++ b/MagickCore/semaphore.c @@ -151,6 +151,17 @@ MagickExport SemaphoreInfo *AllocateSemaphoreInfo(void) ThrowFatalException(ResourceLimitFatalError, "UnableToInitializeSemaphore"); } +#if defined(MAGICKCORE_DEBUG) +#if defined(PTHREAD_MUTEX_ERRORCHECK) + status=pthread_mutex_settype(&mutex_info,PTHREAD_MUTEX_ERRORCHECK); + if (status != 0) + { + errno=status; + ThrowFatalException(ResourceLimitFatalError, + "UnableToInitializeSemaphore"); + } +#endif +#endif status=pthread_mutex_init(&semaphore_info->mutex,&mutex_info); if (status != 0) { -- 2.40.0