Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
bd433c64
Commit
bd433c64
authored
Oct 10, 2011
by
Reinhard Tartler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Imported nx-X11-3.3.0-6.tar.gz
Summary: Imported nx-X11-3.3.0-6.tar.gz Keywords: Imported nx-X11-3.3.0-6.tar.gz into Git repository
parent
55a9311f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
474 additions
and
4 deletions
+474
-4
CHANGELOG
nx-X11/CHANGELOG
+8
-0
CHANGELOG.NX.original
nx-X11/CHANGELOG.NX.original
+8
-0
XlibInt.c
nx-X11/lib/X11/XlibInt.c
+60
-1
XlibInt.c.NX.original
nx-X11/lib/X11/XlibInt.c.NX.original
+60
-1
xprintf.c
nx-X11/programs/Xserver/os/xprintf.c
+59
-0
xprintf.c.NX.original
nx-X11/programs/Xserver/os/xprintf.c.NX.original
+163
-0
xprintf.c.X.original
nx-X11/programs/Xserver/os/xprintf.c.X.original
+104
-0
ddxLoad.c
nx-X11/programs/Xserver/xkb/ddxLoad.c
+6
-1
ddxLoad.c.NX.original
nx-X11/programs/Xserver/xkb/ddxLoad.c.NX.original
+6
-1
No files found.
nx-X11/CHANGELOG
View file @
bd433c64
ChangeLog:
nx-X11-3.3.0-6
- Fixed TR03G02198. Reimplemented Xvprintf() in Xserver/os to handle
the case in which vsnprintf returned -1.
- Returning from _XSeqSyncFunction() and _XReply() if an I/O error is
detected.
nx-X11-3.3.0-5
- Fixed TR01G02163. Signals need to be blocked before the call to
...
...
nx-X11/CHANGELOG.NX.original
View file @
bd433c64
ChangeLog:
nx-X11-3.3.0-6
- Fixed TR03G02198. Reimplemented Xvprintf() in Xserver/os to handle
the case in which vsnprintf returned -1.
- Returning from _XSeqSyncFunction() and _XReply() if an I/O error is
detected.
nx-X11-3.3.0-5
- Fixed TR01G02163. Signals need to be blocked before the call to
...
...
nx-X11/lib/X11/XlibInt.c
View file @
bd433c64
...
...
@@ -877,6 +877,19 @@ int _XSeqSyncFunction(
xGetInputFocusReply
rep
;
register
xReq
*
req
;
#ifdef NX_TRANS_SOCKET
#ifdef NX_TRANS_DEBUG
fprintf
(
stderr
,
"_XSeqSyncFunction: Going to synchronize the display.
\n
"
);
#endif
if
(
dpy
->
flags
&
XlibDisplayIOError
)
{
#ifdef NX_TRANS_DEBUG
fprintf
(
stderr
,
"_XSeqSyncFunction: Returning 0 with I/O error detected.
\n
"
);
#endif
return
0
;
}
#endif
LockDisplay
(
dpy
);
if
((
dpy
->
request
-
dpy
->
last_request_read
)
>=
(
BUFSIZE
/
SIZEOF
(
xReq
)))
{
GetEmptyReq
(
GetInputFocus
,
req
);
...
...
@@ -930,6 +943,10 @@ static void _XFlushInt(
int
congestion
;
#endif
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG)
fprintf
(
stderr
,
"_XFlushInt: Entering flush with [%d] bytes to write.
\n
"
,
(
dpy
->
bufptr
-
dpy
->
buffer
));
#endif
/* This fix resets the bufptr to the front of the buffer so
* additional appends to the bufptr will not corrupt memory. Since
* the server is down, these appends are no-op's anyway but
...
...
@@ -937,6 +954,9 @@ static void _XFlushInt(
*/
if
(
dpy
->
flags
&
XlibDisplayIOError
)
{
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG)
fprintf
(
stderr
,
"_XFlushInt: Returning with I/O error detected.
\n
"
);
#endif
dpy
->
bufptr
=
dpy
->
buffer
;
dpy
->
last_req
=
(
char
*
)
&
_dummy_request
;
return
;
...
...
@@ -1404,6 +1424,15 @@ void _XReadEvents(
dpy
->
flags
|=
XlibDisplayReadEvents
;
i
=
_XRead
(
dpy
,
read_buf
,
(
long
)
len
);
dpy
->
flags
&=
~
XlibDisplayReadEvents
;
#ifdef NX_TRANS_SOCKET
if
(
dpy
->
flags
&
XlibDisplayIOError
)
{
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG)
fprintf
(
stderr
,
"_XReadEvents: Returning with I/O error detected.
\n
"
);
#endif
return
;
}
#endif
if
(
i
==
-
2
)
{
/* special flag from _XRead to say that internal connection has
done XPutBackEvent. Which we can use so we're done. */
...
...
@@ -1841,10 +1870,17 @@ _XSend (
#endif
#ifdef NX_TRANS_SOCKET
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG)
fprintf
(
stderr
,
"_XSend: Sending data with [%d] bytes to write.
\n
"
,
(
dpy
->
bufptr
-
dpy
->
buffer
));
#endif
if
(
!
size
||
(
dpy
->
flags
&
XlibDisplayIOError
))
{
if
(
dpy
->
flags
&
XlibDisplayIOError
)
{
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG)
fprintf
(
stderr
,
"_XSend: Returning with I/O error detected.
\n
"
);
#endif
dpy
->
bufptr
=
dpy
->
buffer
;
dpy
->
last_req
=
(
char
*
)
&
_dummy_request
;
}
...
...
@@ -2222,8 +2258,18 @@ _XReply (
fprintf
(
stderr
,
"_XReply: Going to wait for an X reply.
\n
"
);
#endif
#ifdef NX_TRANS_SOCKET
if
(
dpy
->
flags
&
XlibDisplayIOError
)
{
#ifdef NX_TRANS_DEBUG
fprintf
(
stderr
,
"_XReply: Returning 0 with I/O error detected.
\n
"
);
#endif
return
0
;
}
#else
if
(
dpy
->
flags
&
XlibDisplayIOError
)
return
0
;
#endif
#ifdef XTHREADS
/* create our condition variable and append to list */
...
...
@@ -2239,6 +2285,9 @@ _XReply (
XThread_Self
(),
cvl
);
#endif
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG)
fprintf
(
stderr
,
"_XReply: Going to flush the display buffer.
\n
"
);
#endif
_XFlushInt
(
dpy
,
cvl
?
cvl
->
cv
:
NULL
);
/* if it is not our turn to read a reply off the wire,
* wait til we're at head of list. if there is an event waiter,
...
...
@@ -3583,11 +3632,21 @@ _XIOError (
*/
#ifdef NX_TRANS_TEST
fprintf
(
stderr
,
"_XIOError: Resetting the display buffer
s
.
\n
"
);
fprintf
(
stderr
,
"_XIOError: Resetting the display buffer.
\n
"
);
#endif
dpy
->
bufptr
=
dpy
->
buffer
;
dpy
->
last_req
=
(
char
*
)
&
_dummy_request
;
#ifdef NX_TRANS_TEST
fprintf
(
stderr
,
"_XIOError: Resetting the display flags.
\n
"
);
#endif
dpy
->
flags
&=
~
XlibDisplayProcConni
;
dpy
->
flags
&=
~
XlibDisplayPrivSync
;
dpy
->
flags
&=
~
XlibDisplayReadEvents
;
dpy
->
flags
&=
~
XlibDisplayWriting
;
dpy
->
flags
&=
~
XlibDisplayReply
;
#else
exit
(
1
);
#endif
...
...
nx-X11/lib/X11/XlibInt.c.NX.original
View file @
bd433c64
...
...
@@ -877,6 +877,19 @@ int _XSeqSyncFunction(
xGetInputFocusReply rep;
register xReq *req;
#ifdef NX_TRANS_SOCKET
#ifdef NX_TRANS_DEBUG
fprintf(stderr, "_XSeqSyncFunction: Going to synchronize the display.\n");
#endif
if (dpy->flags & XlibDisplayIOError)
{
#ifdef NX_TRANS_DEBUG
fprintf(stderr, "_XSeqSyncFunction: Returning 0 with I/O error detected.\n");
#endif
return 0;
}
#endif
LockDisplay(dpy);
if ((dpy->request - dpy->last_request_read) >= (BUFSIZE / SIZEOF(xReq))) {
GetEmptyReq(GetInputFocus, req);
...
...
@@ -930,6 +943,10 @@ static void _XFlushInt(
int congestion;
#endif
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG)
fprintf(stderr, "_XFlushInt: Entering flush with [%d] bytes to write.\n",
(dpy->bufptr - dpy->buffer));
#endif
/* This fix resets the bufptr to the front of the buffer so
* additional appends to the bufptr will not corrupt memory. Since
* the server is down, these appends are no-op's anyway but
...
...
@@ -937,6 +954,9 @@ static void _XFlushInt(
*/
if (dpy->flags & XlibDisplayIOError)
{
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG)
fprintf(stderr, "_XFlushInt: Returning with I/O error detected.\n");
#endif
dpy->bufptr = dpy->buffer;
dpy->last_req = (char *)&_dummy_request;
return;
...
...
@@ -1404,6 +1424,15 @@ void _XReadEvents(
dpy->flags |= XlibDisplayReadEvents;
i = _XRead (dpy, read_buf, (long) len);
dpy->flags &= ~XlibDisplayReadEvents;
#ifdef NX_TRANS_SOCKET
if (dpy->flags & XlibDisplayIOError)
{
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG)
fprintf(stderr, "_XReadEvents: Returning with I/O error detected.\n");
#endif
return;
}
#endif
if (i == -2) {
/* special flag from _XRead to say that internal connection has
done XPutBackEvent. Which we can use so we're done. */
...
...
@@ -1841,10 +1870,17 @@ _XSend (
#endif
#ifdef NX_TRANS_SOCKET
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG)
fprintf(stderr, "_XSend: Sending data with [%d] bytes to write.\n",
(dpy->bufptr - dpy->buffer));
#endif
if (!size || (dpy->flags & XlibDisplayIOError))
{
if (dpy->flags & XlibDisplayIOError)
{
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG)
fprintf(stderr, "_XSend: Returning with I/O error detected.\n");
#endif
dpy->bufptr = dpy->buffer;
dpy->last_req = (char *)&_dummy_request;
}
...
...
@@ -2222,8 +2258,18 @@ _XReply (
fprintf(stderr, "_XReply: Going to wait for an X reply.\n");
#endif
#ifdef NX_TRANS_SOCKET
if (dpy->flags & XlibDisplayIOError)
{
#ifdef NX_TRANS_DEBUG
fprintf(stderr, "_XReply: Returning 0 with I/O error detected.\n");
#endif
return 0;
}
#else
if (dpy->flags & XlibDisplayIOError)
return 0;
#endif
#ifdef XTHREADS
/* create our condition variable and append to list */
...
...
@@ -2239,6 +2285,9 @@ _XReply (
XThread_Self(), cvl);
#endif
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG)
fprintf(stderr, "_XReply: Going to flush the display buffer.\n");
#endif
_XFlushInt(dpy, cvl ? cvl->cv : NULL);
/* if it is not our turn to read a reply off the wire,
* wait til we're at head of list. if there is an event waiter,
...
...
@@ -3583,11 +3632,21 @@ _XIOError (
*/
#ifdef NX_TRANS_TEST
fprintf(stderr, "_XIOError: Resetting the display buffer
s
.\n");
fprintf(stderr, "_XIOError: Resetting the display buffer.\n");
#endif
dpy->bufptr = dpy->buffer;
dpy->last_req = (char *) &_dummy_request;
#ifdef NX_TRANS_TEST
fprintf(stderr, "_XIOError: Resetting the display flags.\n");
#endif
dpy->flags &= ~XlibDisplayProcConni;
dpy->flags &= ~XlibDisplayPrivSync;
dpy->flags &= ~XlibDisplayReadEvents;
dpy->flags &= ~XlibDisplayWriting;
dpy->flags &= ~XlibDisplayReply;
#else
exit (1);
#endif
...
...
nx-X11/programs/Xserver/os/xprintf.c
View file @
bd433c64
...
...
@@ -43,6 +43,63 @@
# endif
#endif
#ifdef NXAGENT_SERVER
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#define START_SIZE 256
#define END_SIZE 2048
char
*
Xvprintf
(
const
char
*
format
,
va_list
va
)
{
char
*
ret
;
char
*
newret
;
int
size
;
int
r
;
size
=
0
;
for
(;;)
{
if
(
size
==
0
)
{
ret
=
(
char
*
)
malloc
(
START_SIZE
);
if
(
ret
==
NULL
)
return
NULL
;
size
=
START_SIZE
;
}
else
if
(
size
<
END_SIZE
&&
(
newret
=
(
char
*
)
realloc
(
ret
,
2
*
size
))
!=
NULL
)
{
ret
=
newret
;
size
=
2
*
size
;
}
else
{
free
(
ret
);
return
NULL
;
}
r
=
vsnprintf
(
ret
,
size
,
format
,
va
);
if
(
r
==
-
1
||
r
==
size
||
r
>
size
||
r
==
size
-
1
)
{
continue
;
}
else
{
ret
[
r
]
=
0
;
return
ret
;
}
}
}
#else
char
*
Xvprintf
(
const
char
*
format
,
va_list
va
)
{
...
...
@@ -63,6 +120,8 @@ Xvprintf(const char *format, va_list va)
return
ret
;
}
#endif
char
*
Xprintf
(
const
char
*
format
,
...)
{
char
*
ret
;
...
...
nx-X11/programs/Xserver/os/xprintf.c.NX.original
0 → 100644
View file @
bd433c64
/*
* printf routines which xalloc their buffer
*/
/*
* Copyright (c) 2004 Alexander Gottwald
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name(s) of the above copyright
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/Xos.h>
#include "os.h"
#include <stdarg.h>
#include <stdio.h>
#ifndef va_copy
# ifdef __va_copy
# define va_copy __va_copy
# else
# error "no working va_copy was found"
# endif
#endif
#ifdef NXAGENT_SERVER
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#define START_SIZE 256
#define END_SIZE 2048
char *
Xvprintf(const char *format, va_list va)
{
char *ret;
char *newret;
int size;
int r;
size = 0;
for (;;)
{
if (size == 0)
{
ret = (char *)malloc(START_SIZE);
if (ret == NULL)
return NULL;
size = START_SIZE;
}
else if (size < END_SIZE &&
(newret = (char *) realloc(ret, 2 * size)) != NULL)
{
ret = newret;
size = 2 * size;
}
else
{
free(ret);
return NULL;
}
r = vsnprintf(ret, size, format, va);
if (r == -1 || r == size || r > size || r == size - 1)
{
continue;
}
else
{
ret[r] = 0;
return ret;
}
}
}
#else
char *
Xvprintf(const char *format, va_list va)
{
char *ret;
int size;
va_list va2;
va_copy(va2, va);
size = vsnprintf(NULL, 0, format, va2);
va_end(va2);
ret = (char *)Xalloc(size + 1);
if (ret == NULL)
return NULL;
vsnprintf(ret, size + 1, format, va);
ret[size] = 0;
return ret;
}
#endif
char *Xprintf(const char *format, ...)
{
char *ret;
va_list va;
va_start(va, format);
ret = Xvprintf(format, va);
va_end(va);
return ret;
}
char *
XNFvprintf(const char *format, va_list va)
{
char *ret;
int size;
va_list va2;
va_copy(va2, va);
size = vsnprintf(NULL, 0, format, va2);
va_end(va2);
ret = (char *)XNFalloc(size + 1);
if (ret == NULL)
return NULL;
vsnprintf(ret, size + 1, format, va);
ret[size] = 0;
return ret;
}
char *XNFprintf(const char *format, ...)
{
char *ret;
va_list va;
va_start(va, format);
ret = XNFvprintf(format, va);
va_end(va);
return ret;
}
nx-X11/programs/Xserver/os/xprintf.c.X.original
0 → 100644
View file @
bd433c64
/*
* printf routines which xalloc their buffer
*/
/*
* Copyright (c) 2004 Alexander Gottwald
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name(s) of the above copyright
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/Xos.h>
#include "os.h"
#include <stdarg.h>
#include <stdio.h>
#ifndef va_copy
# ifdef __va_copy
# define va_copy __va_copy
# else
# error "no working va_copy was found"
# endif
#endif
char *
Xvprintf(const char *format, va_list va)
{
char *ret;
int size;
va_list va2;
va_copy(va2, va);
size = vsnprintf(NULL, 0, format, va2);
va_end(va2);
ret = (char *)Xalloc(size + 1);
if (ret == NULL)
return NULL;
vsnprintf(ret, size + 1, format, va);
ret[size] = 0;
return ret;
}
char *Xprintf(const char *format, ...)
{
char *ret;
va_list va;
va_start(va, format);
ret = Xvprintf(format, va);
va_end(va);
return ret;
}
char *
XNFvprintf(const char *format, va_list va)
{
char *ret;
int size;
va_list va2;
va_copy(va2, va);
size = vsnprintf(NULL, 0, format, va2);
va_end(va2);
ret = (char *)XNFalloc(size + 1);
if (ret == NULL)
return NULL;
vsnprintf(ret, size + 1, format, va);
ret[size] = 0;
return ret;
}
char *XNFprintf(const char *format, ...)
{
char *ret;
va_list va;
va_start(va, format);
ret = XNFvprintf(format, va);
va_end(va);
return ret;
}
nx-X11/programs/Xserver/xkb/ddxLoad.c
View file @
bd433c64
...
...
@@ -719,7 +719,12 @@ char tmpname[PATH_MAX];
}
#ifdef TEST
fprintf
(
stderr
,
"XkbDDXCompileKeymapByNames: Executing command [%s].
\n
"
,
buf
);
if
(
buf
!=
NULL
)
fprintf
(
stderr
,
"XkbDDXCompileKeymapByNames: "
"Executing command [%s].
\n
"
,
buf
);
else
fprintf
(
stderr
,
"XkbDDXCompileKeymapByNames: "
"Callin Popen() with null command.
\n
"
);
#endif
#ifndef WIN32
...
...
nx-X11/programs/Xserver/xkb/ddxLoad.c.NX.original
View file @
bd433c64
...
...
@@ -719,7 +719,12 @@ char tmpname[PATH_MAX];
}
#ifdef TEST
fprintf(stderr, "XkbDDXCompileKeymapByNames: Executing command [%s].\n", buf);
if (buf != NULL)
fprintf(stderr, "XkbDDXCompileKeymapByNames: "
"Executing command [%s].\n", buf);
else
fprintf(stderr, "XkbDDXCompileKeymapByNames: "
"Callin Popen() with null command.\n");
#endif
#ifndef WIN32
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment