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
cfa17ffa
Commit
cfa17ffa
authored
Dec 29, 2019
by
Ulrich Sibiller
Committed by
Mike Gabriel
Jan 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Error.c: mark NX changes
nxagentPrintError is derived from XlibInt.c:_XprintDefaultError. Let's add missing code and mark NX changes.
parent
100b2789
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
19 deletions
+24
-19
Error.c
nx-X11/programs/Xserver/hw/nxagent/Error.c
+24
-19
No files found.
nx-X11/programs/Xserver/hw/nxagent/Error.c
View file @
cfa17ffa
...
@@ -114,10 +114,11 @@ int nxagentErrorHandler(Display *dpy, XErrorEvent *event)
...
@@ -114,10 +114,11 @@ int nxagentErrorHandler(Display *dpy, XErrorEvent *event)
return
0
;
return
0
;
}
}
/* copied from XlibInt.c */
/* copied from XlibInt.c:_XprintDefaultError
/* extension stuff roughly commented out */
* We cannot use the whole function because it requires XlibInt
/* FIXME: why? What's wrong with printing extension stuff?
* internals. And we cannot call _XPrintDefaultError because it
We could drop this in favour of _XprintDefaultError then! */
* is not exported.
*/
static
int
nxagentPrintError
(
dpy
,
event
,
fp
)
static
int
nxagentPrintError
(
dpy
,
event
,
fp
)
Display
*
dpy
;
Display
*
dpy
;
XErrorEvent
*
event
;
XErrorEvent
*
event
;
...
@@ -126,11 +127,11 @@ static int nxagentPrintError(dpy, event, fp)
...
@@ -126,11 +127,11 @@ static int nxagentPrintError(dpy, event, fp)
char
buffer
[
BUFSIZ
];
char
buffer
[
BUFSIZ
];
char
mesg
[
BUFSIZ
];
char
mesg
[
BUFSIZ
];
char
number
[
32
];
char
number
[
32
];
char
*
mtype
=
"XlibMessage"
;
c
onst
c
har
*
mtype
=
"XlibMessage"
;
/*
#ifndef NXAGENT_SERVER
register
_XExtension
*
ext
=
(
_XExtension
*
)
NULL
;
register
_XExtension
*
ext
=
(
_XExtension
*
)
NULL
;
_XExtension
*
bext
=
(
_XExtension
*
)
NULL
;
_XExtension
*
bext
=
(
_XExtension
*
)
NULL
;
*/
#endif
XGetErrorText
(
dpy
,
event
->
error_code
,
buffer
,
BUFSIZ
);
XGetErrorText
(
dpy
,
event
->
error_code
,
buffer
,
BUFSIZ
);
XGetErrorDatabaseText
(
dpy
,
mtype
,
"XError"
,
"X Error"
,
mesg
,
BUFSIZ
);
XGetErrorDatabaseText
(
dpy
,
mtype
,
"XError"
,
"X Error"
,
mesg
,
BUFSIZ
);
(
void
)
fprintf
(
fp
,
"%s: %s
\n
"
,
mesg
,
buffer
);
(
void
)
fprintf
(
fp
,
"%s: %s
\n
"
,
mesg
,
buffer
);
...
@@ -141,14 +142,16 @@ static int nxagentPrintError(dpy, event, fp)
...
@@ -141,14 +142,16 @@ static int nxagentPrintError(dpy, event, fp)
snprintf
(
number
,
sizeof
(
number
),
"%d"
,
event
->
request_code
);
snprintf
(
number
,
sizeof
(
number
),
"%d"
,
event
->
request_code
);
XGetErrorDatabaseText
(
dpy
,
"XRequest"
,
number
,
""
,
buffer
,
BUFSIZ
);
XGetErrorDatabaseText
(
dpy
,
"XRequest"
,
number
,
""
,
buffer
,
BUFSIZ
);
}
else
{
}
else
{
/* for (ext = dpy->ext_procs;
#ifndef NXAGENT_SERVER
for
(
ext
=
dpy
->
ext_procs
;
ext
&&
(
ext
->
codes
.
major_opcode
!=
event
->
request_code
);
ext
&&
(
ext
->
codes
.
major_opcode
!=
event
->
request_code
);
ext
=
ext
->
next
)
ext
=
ext
->
next
)
;
;
if (ext)
if
(
ext
)
{
strncpy
(
buffer
,
ext
->
name
,
BUFSIZ
);
strncpy
(
buffer
,
ext
->
name
,
BUFSIZ
);
else
buffer
[
BUFSIZ
-
1
]
=
'\0'
;
*/
}
else
#endif
buffer
[
0
]
=
'\0'
;
buffer
[
0
]
=
'\0'
;
}
}
(
void
)
fprintf
(
fp
,
" (%s)
\n
"
,
buffer
);
(
void
)
fprintf
(
fp
,
" (%s)
\n
"
,
buffer
);
...
@@ -157,19 +160,19 @@ static int nxagentPrintError(dpy, event, fp)
...
@@ -157,19 +160,19 @@ static int nxagentPrintError(dpy, event, fp)
mesg
,
BUFSIZ
);
mesg
,
BUFSIZ
);
fputs
(
" "
,
fp
);
fputs
(
" "
,
fp
);
(
void
)
fprintf
(
fp
,
mesg
,
event
->
minor_code
);
(
void
)
fprintf
(
fp
,
mesg
,
event
->
minor_code
);
/*
#ifndef NXAGENT_SERVER
if
(
ext
)
{
if
(
ext
)
{
snprintf
(
mesg
,
sizeof
(
mesg
),
"%s.%d"
,
ext
->
name
,
event
->
minor_code
);
snprintf
(
mesg
,
sizeof
(
mesg
),
"%s.%d"
,
ext
->
name
,
event
->
minor_code
);
XGetErrorDatabaseText
(
dpy
,
"XRequest"
,
mesg
,
""
,
buffer
,
BUFSIZ
);
XGetErrorDatabaseText
(
dpy
,
"XRequest"
,
mesg
,
""
,
buffer
,
BUFSIZ
);
(
void
)
fprintf
(
fp
,
" (%s)"
,
buffer
);
(
void
)
fprintf
(
fp
,
" (%s)"
,
buffer
);
}
}
*/
#endif
fputs
(
"
\n
"
,
fp
);
fputs
(
"
\n
"
,
fp
);
}
}
if
(
event
->
error_code
>=
128
)
{
if
(
event
->
error_code
>=
128
)
{
/* kludge, try to find the extension that caused it */
/* kludge, try to find the extension that caused it */
buffer
[
0
]
=
'\0'
;
buffer
[
0
]
=
'\0'
;
/*
#ifndef NXAGENT_SERVER
for
(
ext
=
dpy
->
ext_procs
;
ext
;
ext
=
ext
->
next
)
{
for
(
ext
=
dpy
->
ext_procs
;
ext
;
ext
=
ext
->
next
)
{
if
(
ext
->
error_string
)
if
(
ext
->
error_string
)
(
*
ext
->
error_string
)(
dpy
,
event
->
error_code
,
&
ext
->
codes
,
(
*
ext
->
error_string
)(
dpy
,
event
->
error_code
,
&
ext
->
codes
,
...
@@ -187,7 +190,7 @@ static int nxagentPrintError(dpy, event, fp)
...
@@ -187,7 +190,7 @@ static int nxagentPrintError(dpy, event, fp)
snprintf
(
buffer
,
sizeof
(
buffer
),
"%s.%d"
,
bext
->
name
,
snprintf
(
buffer
,
sizeof
(
buffer
),
"%s.%d"
,
bext
->
name
,
event
->
error_code
-
bext
->
codes
.
first_error
);
event
->
error_code
-
bext
->
codes
.
first_error
);
else
else
*/
#endif
strcpy
(
buffer
,
"Value"
);
strcpy
(
buffer
,
"Value"
);
XGetErrorDatabaseText
(
dpy
,
mtype
,
buffer
,
""
,
mesg
,
BUFSIZ
);
XGetErrorDatabaseText
(
dpy
,
mtype
,
buffer
,
""
,
mesg
,
BUFSIZ
);
if
(
mesg
[
0
])
{
if
(
mesg
[
0
])
{
...
@@ -196,12 +199,12 @@ static int nxagentPrintError(dpy, event, fp)
...
@@ -196,12 +199,12 @@ static int nxagentPrintError(dpy, event, fp)
fputs
(
"
\n
"
,
fp
);
fputs
(
"
\n
"
,
fp
);
}
}
/* let extensions try to print the values */
/* let extensions try to print the values */
/*
#ifndef NXAGENT_SERVER
for
(
ext
=
dpy
->
ext_procs
;
ext
;
ext
=
ext
->
next
)
{
for
(
ext
=
dpy
->
ext_procs
;
ext
;
ext
=
ext
->
next
)
{
if
(
ext
->
error_values
)
if
(
ext
->
error_values
)
(
*
ext
->
error_values
)(
dpy
,
event
,
fp
);
(
*
ext
->
error_values
)(
dpy
,
event
,
fp
);
}
}
*/
#endif
}
else
if
((
event
->
error_code
==
BadWindow
)
||
}
else
if
((
event
->
error_code
==
BadWindow
)
||
(
event
->
error_code
==
BadPixmap
)
||
(
event
->
error_code
==
BadPixmap
)
||
(
event
->
error_code
==
BadCursor
)
||
(
event
->
error_code
==
BadCursor
)
||
...
@@ -229,10 +232,12 @@ static int nxagentPrintError(dpy, event, fp)
...
@@ -229,10 +232,12 @@ static int nxagentPrintError(dpy, event, fp)
mesg
,
BUFSIZ
);
mesg
,
BUFSIZ
);
fputs
(
" "
,
fp
);
fputs
(
" "
,
fp
);
(
void
)
fprintf
(
fp
,
mesg
,
event
->
serial
);
(
void
)
fprintf
(
fp
,
mesg
,
event
->
serial
);
/* XGetErrorDatabaseText(dpy, mtype, "CurrentSerial", "Current Serial #%d",
#ifndef NXAGENT_SERVER
XGetErrorDatabaseText
(
dpy
,
mtype
,
"CurrentSerial"
,
"Current Serial #%d"
,
mesg
,
BUFSIZ
);
mesg
,
BUFSIZ
);
fputs
(
"
\n
"
,
fp
);
fputs
(
"
\n
"
,
fp
);
(void) fprintf(fp, mesg, dpy->request); */
(
void
)
fprintf
(
fp
,
mesg
,
(
unsigned
long
long
)(
X_DPY_GET_REQUEST
(
dpy
)));
#endif
fputs
(
"
\n
"
,
fp
);
fputs
(
"
\n
"
,
fp
);
if
(
event
->
error_code
==
BadImplementation
)
return
0
;
if
(
event
->
error_code
==
BadImplementation
)
return
0
;
return
1
;
return
1
;
...
...
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