1276N/Aindex d15b326..28185fe 100644
1276N/A@@ -72,6 +72,7 @@ AC_SUBST(LDFLAGS_FOR_BUILD)
1276N/A # Map function checks to old Imake #defines
1276N/A # darwin through Snow Leopard has poll() but can't be used to poll character devices.
1276N/A darwin@<:@789@:>@*|darwin10*) ;;
1072N/A@@ -125,6 +125,7 @@ typedef int XtCacheType;
761N/A #define XtCacheAll 0x002
761N/A #define XtCacheByDisplay 0x003
761N/A #define XtCacheRefCount 0x100
761N/A+#define XtCacheXmRefCount 0x200
761N/A /****************************************************************
1072N/A@@ -253,6 +254,8 @@ typedef void (*XtDestructor)(
761N/A Cardinal* /* num_args */
761N/A+typedef XtPointer (*XtReplicator)(XtPointer);
761N/A typedef Opaque XtCacheRef;
761N/A typedef Opaque XtActionHookId;
1072N/A@@ -656,6 +659,17 @@ extern void XtSetTypeConverter(
761N/A XtDestructor /* destructor */
761N/A+extern void _XtSetTypeConverter(
761N/A+ _Xconst _XtString /* from_type */,
761N/A+ _Xconst _XtString /* to_type */,
761N/A+ XtTypeConverter /* converter */,
761N/A+ XtConvertArgList /* convert_args */,
761N/A+ Cardinal /* num_args */,
761N/A+ XtCacheType /* cache_type */,
761N/A+ XtDestructor /* destructor */,
761N/A+ XtReplicator /* replicator */
761N/A extern void XtAppSetTypeConverter(
761N/A XtAppContext /* app_context */,
761N/A _Xconst _XtString /* from_type */,
1276N/Aindex cea8fd3..265b162 100644
1072N/A@@ -87,6 +87,7 @@ typedef struct _ConverterRec {
351N/A XrmRepresentation from, to;
351N/A XtTypeConverter converter;
351N/A XtDestructor destructor;
761N/A+ XtReplicator replicator;
351N/A unsigned short num_args;
351N/A unsigned int do_ref_count:1;
351N/A unsigned int new_style:1;
1072N/A@@ -94,11 +95,25 @@ typedef struct _ConverterRec {
351N/A-#define ConvertArgs(p) ((XtConvertArgList)((p)+1))
761N/A+#define ConvertArgs(p) ((XtConvertArgList)((p)+(ptrdiff_t)1))
351N/A /* used for old-style type converter cache only */
351N/A static Heap globalHeap = {NULL, NULL, 0};
351N/A+void TableAddConverter(
351N/A+ XrmRepresentation from_type,
351N/A+ XrmRepresentation to_type,
351N/A+ XtTypeConverter converter,
351N/A+ XtConvertArgList convert_args,
351N/A+ XtCacheType cache_type,
351N/A+ XtDestructor destructor,
351N/A+ XtReplicator replicator,
351N/A void _XtSetDefaultConverterTable(
1072N/A@@ -117,13 +132,11 @@ void _XtSetDefaultConverterTable(
351N/A XtCacheType cache_type;
351N/A for (i = CONVERTHASHSIZE; --i >= 0; ) {
351N/A for (rec = *globalConverterTable++; rec; rec = rec->next) {
351N/A- cache_type = rec->cache_type;
351N/A- if (rec->do_ref_count)
351N/A- cache_type |= XtCacheRefCount;
351N/A- _XtTableAddConverter(*table, rec->from, rec->to, rec->converter,
351N/A+ cache_type = rec->cache_type | (rec->do_ref_count & 0xff00);
351N/A+ TableAddConverter(*table, rec->from, rec->to, rec->converter,
351N/A ConvertArgs(rec), rec->num_args,
351N/A rec->new_style, cache_type,
351N/A- rec->destructor, True);
351N/A+ rec->destructor, rec->replicator, True);
1072N/A@@ -155,10 +168,14 @@ typedef struct _CacheRec {
351N/A XtTypeConverter converter;
351N/A+ XtDestructor destructor;
351N/A+ XtReplicator replicator;
351N/A unsigned short num_args;
351N/A unsigned int conversion_succeeded:1;
351N/A unsigned int has_ext:1;
351N/A unsigned int is_refcounted:1;
351N/A+ unsigned int ref_count;
351N/A unsigned int must_be_freed:1;
351N/A unsigned int from_is_value:1;
351N/A unsigned int to_is_value:1;
1072N/A@@ -166,15 +183,7 @@ typedef struct _CacheRec {
351N/A-typedef struct _CacheRecExt {
351N/A- XtDestructor destructor;
351N/A-#define CEXT(p) ((CacheRecExt *)((p)+1))
351N/A-#define CARGS(p) ((p)->has_ext ? (XrmValue *)(CEXT(p)+1) : (XrmValue *)((p)+1))
761N/A+#define CARGS(p) (XrmValue *)((p)+(ptrdiff_t)1)
351N/A #define CACHEHASHSIZE 256
351N/A #define CACHEHASHMASK 255
1276N/A@@ -183,6 +192,28 @@ typedef CachePtr CacheHashTable[CACHEHASHSIZE];
351N/A static CacheHashTable cacheHashTable;
351N/A void _XtTableAddConverter(
351N/A+ XrmRepresentation from_type,
351N/A+ XrmRepresentation to_type,
351N/A+ XtTypeConverter converter,
351N/A+ XtConvertArgList convert_args,
351N/A+ XtCacheType cache_type,
351N/A+ XtDestructor destructor,
351N/A+ unsigned short cache_flags;
351N/A+ cache_flags = cache_type & (XtCacheNone | XtCacheAll |
351N/A+ XtCacheByDisplay | XtCacheRefCount);
351N/A+ TableAddConverter(table, from_type, to_type, converter, convert_args, num_args,
351N/A+ new_style, cache_type, destructor, 0, global);
351N/A+void TableAddConverter(
351N/A XrmRepresentation from_type,
351N/A XrmRepresentation to_type,
1072N/A@@ -192,6 +223,7 @@ void _XtTableAddConverter(
351N/A XtCacheType cache_type,
351N/A XtDestructor destructor,
351N/A+ XtReplicator replicator,
351N/A register ConverterPtr *pp;
1072N/A@@ -215,6 +247,7 @@ void _XtTableAddConverter(
351N/A p->converter = converter;
351N/A p->destructor = destructor;
351N/A+ p->replicator = replicator;
351N/A p->num_args = num_args;
1072N/A@@ -224,21 +257,21 @@ void _XtTableAddConverter(
351N/A p->do_ref_count = False;
351N/A if (destructor || (cache_type & 0xff)) {
351N/A p->cache_type = cache_type & 0xff;
351N/A- if (cache_type & XtCacheRefCount)
351N/A- p->do_ref_count = True;
351N/A+ p->do_ref_count = cache_type & 0xff00;
351N/A p->cache_type = XtCacheNone;
351N/A-void XtSetTypeConverter(
351N/A+void _XtSetTypeConverter(
351N/A register _Xconst char* from_type,
351N/A register _Xconst char* to_type,
351N/A- XtTypeConverter converter,
351N/A+ XtTypeConverter converter,
351N/A XtConvertArgList convert_args,
351N/A- XtCacheType cache_type,
351N/A- XtDestructor destructor
351N/A+ XtCacheType cache_type,
351N/A+ XtDestructor destructor,
351N/A+ XtReplicator replicator
351N/A ProcessContext process;
1072N/A@@ -253,21 +286,41 @@ void XtSetTypeConverter(
351N/A to = XrmStringToRepresentation(to_type);
351N/A if (!process->globalConverterTable) {
351N/A- process->globalConverterTable = (ConverterTable)
351N/A- __XtCalloc(CONVERTHASHSIZE, (unsigned)sizeof(ConverterPtr));
351N/A+ process->globalConverterTable = (ConverterTable)
351N/A+ __XtCalloc(CONVERTHASHSIZE, (unsigned)sizeof(ConverterPtr));
351N/A- _XtTableAddConverter(process->globalConverterTable, from, to,
351N/A- converter, convert_args,
351N/A- num_args, True, cache_type, destructor, True);
351N/A+ TableAddConverter(process->globalConverterTable, from, to, converter,
351N/A+ convert_args, num_args, True, cache_type, destructor,
351N/A- _XtTableAddConverter(app->converterTable, from, to,
351N/A- converter, convert_args,
351N/A- num_args, True, cache_type, destructor, True);
351N/A+ TableAddConverter(app->converterTable, from, to, converter,
351N/A+ convert_args, num_args, True, cache_type,
351N/A+ destructor, replicator, True);
351N/A+void XtSetTypeConverter(
351N/A+ register _Xconst char* from_type,
351N/A+ register _Xconst char* to_type,
351N/A+ XtTypeConverter converter,
351N/A+ XtConvertArgList convert_args,
351N/A+ XtCacheType cache_type,
351N/A+ XtDestructor destructor
351N/A+ unsigned short cache_flags;
351N/A+ cache_flags = cache_type & (XtCacheNone | XtCacheAll |
351N/A+ XtCacheByDisplay | XtCacheRefCount);
351N/A+ _XtSetTypeConverter(from_type, to_type, converter, convert_args, num_args,
351N/A+ cache_flags, destructor, 0);
351N/A void XtAppSetTypeConverter(
351N/A register _Xconst char* from_type,
1072N/A@@ -357,6 +410,7 @@ CacheEnter(
351N/A XtDestructor destructor,
351N/A+ XtReplicator replicator,
351N/A register CachePtr *pHashEntry;
1072N/A@@ -366,34 +420,22 @@ CacheEnter(
351N/A pHashEntry = &cacheHashTable[hash & CACHEHASHMASK];
351N/A- if ((succeeded && destructor) || do_ref) {
351N/A- p = (CachePtr) _XtHeapAlloc(heap, (sizeof(CacheRec) +
351N/A- num_args * sizeof(XrmValue)));
351N/A- CEXT(p)->prev = pHashEntry;
351N/A- CEXT(p)->destructor = succeeded ? destructor : NULL;
351N/A- CEXT(p)->closure = closure;
351N/A- CEXT(p)->ref_count = 1;
351N/A- p = (CachePtr)_XtHeapAlloc(heap, (sizeof(CacheRec) +
351N/A- num_args * sizeof(XrmValue)));
351N/A+ p = (CachePtr)_XtHeapAlloc(heap,
351N/A+ (sizeof(CacheRec) + num_args * sizeof(XrmValue)));
351N/A p->conversion_succeeded = succeeded;
351N/A p->is_refcounted = do_ref;
351N/A p->must_be_freed = do_free;
351N/A- if (p->next && p->next->has_ext)
351N/A- CEXT(p->next)->prev = &p->next;
351N/A p->tag = (XtPointer)heap;
351N/A p->converter = converter;
351N/A+ p->destructor = destructor;
351N/A+ p->replicator = replicator;
351N/A p->from_is_value = True;
1072N/A@@ -416,14 +458,31 @@ CacheEnter(
351N/A p->to_is_value = False;
351N/A- p->to_is_value = True;
351N/A- p->to_is_value = False;
351N/A- (void) memmove((char *)p->
to.addr, (char *)to->addr, to->size);
351N/A+ XPointer src_ptr, dest_ptr, gptr;
351N/A+ p->to_is_value = True;
351N/A+ p->to_is_value = False;
351N/A+ dest_ptr = p->
to.addr = (XPointer)_XtHeapAlloc(heap, to->size);
351N/A+ if (do_ref & XtCacheXmRefCount) {
351N/A+ gptr = (*(p->replicator))(*(XtPointer *)(to->addr));
351N/A+ src_ptr = (XtPointer)&gptr;
351N/A+ memmove(dest_ptr, src_ptr, to->size);
351N/A+ if ((succeeded && destructor) || do_ref) {
1072N/A@@ -431,32 +490,39 @@ CacheEnter(
351N/A static void FreeCacheRec(
351N/A- if (CEXT(p)->destructor) {
351N/A- Cardinal num_args = p->num_args;
351N/A- XrmValue *args = NULL;
351N/A- (*CEXT(p)->destructor) (app, &toc, CEXT(p)->closure, args,
351N/A- *(CEXT(p)->prev) = p->next;
351N/A- if (p->next && p->next->has_ext)
351N/A- CEXT(p->next)->prev = CEXT(p)->prev;
351N/A- if (p->next && p->next->has_ext)
351N/A- CEXT(p->next)->prev = prev;
351N/A+ CachePtr cachep, *cachepp;
351N/A+ cachepp = &cacheHashTable[p->hash & CACHEHASHMASK];
351N/A+ while (cachep = *cachepp) {
351N/A+ *cachepp = cachep->next;
351N/A+ cachepp = &cachep->next;
351N/A+ Cardinal num_args=p->num_args;
351N/A+ (*p->destructor)(app, &toc, p->closure, args, &num_args);
351N/A if (p->must_be_freed) {
1072N/A@@ -480,18 +546,18 @@ void _XtCacheFlushTag(
351N/A- register CachePtr *prev;
351N/A+ register CachePtr *next_link;
351N/A for (i = CACHEHASHSIZE; --i >= 0;) {
351N/A- prev = &cacheHashTable[i];
351N/A- while ((rec = *prev)) {
351N/A+ next_link = &cacheHashTable[i];
351N/A+ while ((rec = *next_link)) {
351N/A+ next_link = &rec->next;
351N/A- FreeCacheRec(app, rec, prev);
351N/A+ FreeCacheRec(app, rec, False);
351N/A+ cacheHashTable[i] = 0;
1072N/A@@ -641,7 +707,12 @@ void XtDirectConvert(
351N/A /* Try to find cache entry for conversion */
351N/A hash = ((long) converter >> 2) + from->size + *((char *) from->addr);
351N/A- if (from->size > 1) hash += ((char *) from->addr)[1];
351N/A+ if (sizeof(long) == 4)
351N/A+ hash += ((char *) from->addr)[1];
351N/A+ hash += ((char *) from->addr)[6];
351N/A for (p = cacheHashTable[hash & CACHEHASHMASK]; p; p = p->next) {
1072N/A@@ -685,7 +756,7 @@ void XtDirectConvert(
351N/A CacheEnter(&globalHeap, (XtTypeConverter)converter, args, num_args,
351N/A from, to, (to->addr != NULL), hash, False, False,
351N/A- (XtDestructor)NULL, NULL);
351N/A+ (XtDestructor)NULL, NULL, 0);
1072N/A@@ -726,6 +797,7 @@ CallConverter(
351N/A+ XPointer from_addr, gptr;
351N/A if (!cP || ((cP->cache_type == XtCacheNone) && !cP->destructor)) {
1072N/A@@ -738,7 +810,12 @@ CallConverter(
351N/A /* Try to find cache entry for conversion */
351N/A hash = ((long)(converter) >> 2) + from->size + *((char *) from->addr);
351N/A- if (from->size > 1) hash += ((char *) from->addr)[1];
351N/A+ if (sizeof(long) == 4)
351N/A+ hash += ((char *) from->addr)[1];
351N/A+ hash += ((char *) from->addr)[6];
351N/A if (cP->cache_type != XtCacheNone) {
351N/A for (p = cacheHashTable[hash & CACHEHASHMASK]; p; p = p->next){
1072N/A@@ -770,14 +847,18 @@ CallConverter(
761N/A+ if (cP->do_ref_count & XtCacheXmRefCount) {
351N/A+ from_addr = (XPointer)&gptr;
351N/A+ } else if (p->to_is_value) {
351N/A- (void) memmove((char *)to->addr,
351N/A+ memmove((char *)to->addr, from_addr,
351N/A } else { /* old-style call */
1072N/A@@ -787,7 +868,7 @@ CallConverter(
351N/A if (p->is_refcounted) {
351N/A *cache_ref_return = (XtCacheRef)p;
1072N/A@@ -810,7 +891,7 @@ CallConverter(
351N/A XtPointer closure = NULL;
351N/A unsigned int supplied_size = to->size;
351N/A- Boolean do_ref = cP->do_ref_count && cache_ref_return;
351N/A+ unsigned short do_ref;
351N/A Boolean do_free = False;
351N/A (*(XtTypeConverter)converter)(dpy, args, &num_args, from, to, &closure);
1072N/A@@ -823,6 +904,8 @@ CallConverter(
351N/A+ do_ref = cache_ref_return ? cP->do_ref_count : 0;
351N/A if ((cP->cache_type == XtCacheNone) || do_ref) {
1072N/A@@ -834,8 +917,12 @@ CallConverter(
351N/A heap = &XtDisplayToApplicationContext(dpy)->heap;
351N/A- p = CacheEnter(heap, converter, args, num_args, from, to, retval,
351N/A- hash, do_ref, do_free, cP->destructor, closure);
351N/A+ if (do_ref || !(cP->do_ref_count & XtCacheXmRefCount)) {
351N/A+ p = CacheEnter(heap, converter, args, num_args, from, to, retval,
351N/A+ hash, do_ref, do_free, cP->destructor,
351N/A+ cP->replicator, closure);
351N/A *cache_ref_return = (XtCacheRef)p;
351N/A else if (cache_ref_return)
1072N/A@@ -1061,8 +1148,8 @@ void XtAppReleaseCacheRefs(
351N/A for (r = (CachePtr*)refs; (p = *r); r++) {
351N/A- if (p->is_refcounted && --(CEXT(p)->ref_count) == 0) {
351N/A- FreeCacheRec(app, p, NULL);
351N/A+ if (p->is_refcounted && (--p->ref_count) == 0) {
351N/A+ FreeCacheRec(app, p, True);
1072N/A@@ -1078,7 +1165,6 @@ void XtCallbackReleaseCacheRefList(
351N/A XtAppReleaseCacheRefs( XtWidgetToApplicationContext(widget),
351N/A (XtCacheRef*)closure );
1072N/A@@ -405,8 +405,7 @@ xtCreate(
761N/A CompileCallbacks(widget);
761N/A if (cache_refs != NULL) {
761N/A- XtAddCallback(widget, XtNdestroyCallback,
761N/A- XtCallbackReleaseCacheRefList, (XtPointer)cache_refs );
1276N/Aindex 4ccf079..72ed668 100644
1072N/A@@ -323,12 +323,15 @@ _XtAppInit(
351N/A * Save away argv and argc so we can set the properties later
351N/A- saved_argv = (String *)
351N/A- __XtMalloc( (Cardinal)((*argc_in_out + 1) * sizeof(String)) );
761N/A- for (i = 0 ; i < *argc_in_out ; i++) saved_argv[i] = (*argv_in_out)[i];
761N/A- saved_argv[i] = NULL; /* NULL terminate that sucker. */
351N/A+ if(*argv_in_out != NULL) {
351N/A+ saved_argv = (String *)
351N/A+ __XtMalloc( (Cardinal)((*argc_in_out + 1) * sizeof(String)) );
351N/A+ for (i = 0 ; i < *argc_in_out ; i++) saved_argv[i] = (*argv_in_out)[i];
351N/A+ saved_argv[i] = NULL; /* NULL terminate that sucker. */
351N/A *app_context_return = XtCreateApplicationContext();
1276N/Aindex 11823d6..7c15e83 100644
1072N/A@@ -563,6 +563,14 @@ void XtRegisterDrawable(
351N/A+/* need this for backward compatability */
351N/A+void _XtRegisterWindow(window, widget)
351N/A+ XtRegisterDrawable(XtDisplay(widget), (Drawable)window, widget);
351N/A void XtUnregisterDrawable(
1072N/A@@ -613,6 +621,14 @@ void XtUnregisterDrawable(
351N/A+/* need this for backward compatability */
351N/A+void _XtUnregisterWindow(window, widget)
351N/A+ register Window window;
351N/A+ register Widget widget;
351N/A+ XtUnregisterDrawable(XtDisplay(widget), (Drawable)window);
351N/A static void ExpandWWTable(
1072N/A@@ -330,6 +330,12 @@ _XtMakeGeometryRequest (
351N/A returnCode = (*manager)(widget, request, reply);
351N/A+ /* leob fix for bug 4153816 */
351N/A+ if (returnCode == XtGeometryDone && XtIsRealized(widget) &&
1276N/Aindex 9783deb..2a5a8a8 100644
1276N/A@@ -473,7 +473,7 @@ static String _XtDefaultLanguageProc(
351N/A if (! XSetLocaleModifiers(""))
351N/A XtWarning("X locale modifiers not supported, using default");
351N/A- return setlocale(LC_ALL, NULL); /* re-query in case overwritten */
351N/A+ return setlocale(LC_CTYPE, NULL); /* re-query in case overwritten */
351N/A XtLanguageProc XtSetLanguageProc(
1276N/A@@ -994,8 +994,13 @@ Widget XtOpenApplication(XtAppContext *app_context_return,
351N/A XtSetArg(args[num], XtNscreen, DefaultScreenOfDisplay(dpy)); num++;
351N/A- XtSetArg(args[num], XtNargc, saved_argc); num++;
351N/A- XtSetArg(args[num], XtNargv, argv_in_out); num++;
351N/A+ /* only set argc and argv if argv_in_out[0] is not NULL */
351N/A+ if (argv_in_out && argv_in_out[0]) {
351N/A+ XtSetArg(args[num], XtNargc, saved_argc);
351N/A+ XtSetArg(args[num], XtNargv, argv_in_out);
351N/A merged_args = XtMergeArgLists(args_in, num_args_in, args, num);
761N/A libXt_la_LIBADD = @XT_LIBS@
761N/A-libXt_la_LDFLAGS = -version-number 6:0:0 -no-undefined
761N/A+libXt_la_LDFLAGS = -version-number 4:0:0 -no-undefined \
1466N/A+ -M $(top_srcdir)/../mapfile-vers -lc
1276N/A # The util directory contains a program that builds some of the sources.
1072N/A@@ -347,6 +347,51 @@ static void AdjustTimes (
351N/A+static void CheckAndTrimTimes(XtAppContext app, wait_times_ptr_t wt)
351N/A+ XtAppErrorMsg(app, "communicationError", "select",
351N/A+ XtCXtToolkitError, "Resetting timer values: zero_time=%lu:%lu, "
351N/A+ "wait_time=%lu:%lu, max_wait_time=%lu:%lu, cur_time=%lu:%lu",
351N/A+ memset(&zero_time, 0, sizeof(zero_time)); /* Ensure the integrity of */
351N/A+ { /* acceptable range if nec. */
351N/A+ /* significant at this level.) */
351N/A+ if (app->timerQueue != NULL) /* Do the same for the head of */
351N/A+ { /* the timer queue if necessary. */
351N/A+ TIMEDELTA(tv, app->timerQueue->te_timer_value, wt->cur_time);
351N/A+ XtAppErrorMsg(app, "selectError", "timerQueue",
351N/A+ XtCXtToolkitError, "timerQueue value %lu:%lu is invalid",
351N/A+ ADD_TIME(app->timerQueue->te_timer_value, wt->cur_time, tv);
1072N/A@@ -629,20 +674,56 @@ WaitLoop:
351N/A * interrupt occured recalculate time value and wait again.
351N/A- if (errno == EINTR || errno == EAGAIN) {
351N/A- if (errno == EAGAIN) {
351N/A- errno = 0; /* errno is not self reseting */
351N/A- errno = 0; /* errno is not self reseting */
761N/A- /* was it interrupted by a signal that we care about? */
761N/A- if (!ignoreSignals && app->signalQueue != NULL) {
761N/A- SignalEventRec *se_ptr = app->signalQueue;
761N/A- while (se_ptr != NULL) {
761N/A- if (se_ptr->se_notice) {
761N/A- if (block && howlong != NULL)
351N/A+ if (errno == EAGAIN) {
351N/A+ errno = 0; /* errno is not self reseting */
351N/A+ } else if (errno == EBADF) {
351N/A+ /* Bug 4482749 - If we have a bad FD stop monitoring it */
351N/A+ struct timeval tv={0};
351N/A+ String param = bad_fd;
351N/A+ Cardinal param_count = 1;
351N/A+ * Get rid of any input procedures on the bad FD
351N/A+ * and regenerate the list of FDs we listen to.
351N/A+ while (app->input_list[i] != NULL) {
351N/A+ XtRemoveInput((XtInputId)app->input_list[i]);
351N/A+ InitFds (app, ignoreEvents, ignoreInputs, &wf);
351N/A+ sprintf(bad_fd, "%d", errno);
351N/A+ XtAppWarningMsg(app, "communicationError", "select",
351N/A+ "Select failed; error code %s",
351N/A+ ¶m, ¶m_count);
351N/A+ sprintf(bad_fd, "EBADF error in select() call for file descriptor %d", i);
351N/A+ XtAppWarning(app, param);
351N/A+ } else if (errno == EINTR) {
351N/A+ /* was it interrupted by a signal that we care about? */
351N/A+ if (!ignoreSignals && app->signalQueue != NULL) {
351N/A+ SignalEventRec *se_ptr = app->signalQueue;
351N/A+ while (se_ptr != NULL) {
351N/A+ if (se_ptr->se_notice) {
351N/A+ if (block && howlong != NULL)
1072N/A@@ -687,17 +768,33 @@ WaitLoop:
351N/A- Cardinal param_count = 1;
351N/A- sprintf( Errno, "%d", errno);
351N/A- XtAppWarningMsg(app, "communicationError","select",
351N/A- XtCXtToolkitError,"Select failed; error code %s",
351N/A- ¶m, ¶m_count);
761N/A+ } else if (errno == EINVAL) { /* (Can be recovered from if */
761N/A+ struct timeval tv={0};
351N/A+ /* Do a non-blocking select to */
351N/A+ /* eliminate any timeout errors.*/
351N/A+ if (nfds == -1) { /* Now try to sort out the good */
351N/A+ if (errno == EINVAL) { /* and the bad from the ugly. */
351N/A+ char Errno[12]; /* (This is ugly). */
351N/A+ Cardinal param_count = 1;
351N/A+ sprintf(Errno, "%d", errno);
351N/A+ XtAppErrorMsg(app, "communicationError", "select",
351N/A+ XtCXtToolkitError, "Select failed; error code %s",
351N/A+ ¶m, ¶m_count);
351N/A+ XtAppError(app, "EINVAL error in select() call");
351N/A+ } else { /* If the new error is not about */
351N/A+ /* an invalid select() parameter,*/
351N/A+ continue; /* then simply try again. */
351N/A+ } else { /* (Else the error appears to be */
351N/A+ /* in the timeout parameter.) */
351N/A+ CheckAndTrimTimes(app, &wt);
351N/A } /* timed out or input available */
1276N/A@@ -750,6 +847,33 @@ WaitLoop:
351N/A #define SeCallProc(ptr) \
351N/A (*ptr->se_proc) (ptr->se_closure, (XtSignalId*)&ptr);
351N/A+#ifdef sun /*SUNSOFT */
351N/A+int _XtwaitForSomething(
351N/A+ _XtBoolean ignoreTimers,
351N/A+ _XtBoolean ignoreInputs,
351N/A+ _XtBoolean ignoreEvents,
351N/A+ unsigned long *howlong,
351N/A+/* fix for bug 4185875 leob */
351N/A+return _XtWaitForSomething(app,
351N/A+ ignoreEvents, ignoreTimers, ignoreInputs, TRUE,
351N/A+/* fix for bug 4185875 leob */
351N/A+return _XtWaitForSomething(app,
351N/A+ ignoreEvents, ignoreTimers, ignoreInputs, TRUE,