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
1ccc6be6
Unverified
Commit
1ccc6be6
authored
Apr 20, 2017
by
Mihai Moldovan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sunweaver-pr/enhance-displayfd-auto-detection' into 3.6.x
Attributes GH PR #419:
https://github.com/ArcticaProject/nx-libs/pull/419
parents
7d0b7055
9865f73b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
2 deletions
+37
-2
nxagent.1
nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1
+17
-2
connection.c
nx-X11/programs/Xserver/os/connection.c
+20
-0
No files found.
nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1
View file @
1ccc6be6
...
@@ -180,8 +180,23 @@ causes the server to generate a core dump on fatal errors.
...
@@ -180,8 +180,23 @@ causes the server to generate a core dump on fatal errors.
specifies a file descriptor in the launching process. Rather than specifying
specifies a file descriptor in the launching process. Rather than specifying
a display number, the X server will attempt to listen on successively higher
a display number, the X server will attempt to listen on successively higher
display numbers, and upon finding a free one, will write the port number back
display numbers, and upon finding a free one, will write the port number back
on this file descriptor as a newline-terminated string. The \-pn option is
on this file descriptor as a newline-terminated string. The \fB\-pn\fR option is
ignored when using \-displayfd.
ignored when using \fB\-displayfd\fR.
nxagent specific:
(1) Other than in X.org's Xserver, you can use \fB\-displayfd\fR in
conjunction with an explicit display number. If the explicit display number
is not available (i.e., already in use), nxagent tries to figure out the next
available display number,
e.g.:
\fBnxagent\fR \fI\-displayfd 2 :50\fR
(2) If -displayfd <X> is given with <X> equaling 2 (STDERR), then the
display number string written to STDERR is beautified with some human-readable
(machine-parseable) text.
.TP 8
.TP 8
.B \-deferglyphs \fIwhichfonts\fP
.B \-deferglyphs \fIwhichfonts\fP
specifies the types of fonts for which the server should attempt to use
specifies the types of fonts for which the server should attempt to use
...
...
nx-X11/programs/Xserver/os/connection.c
View file @
1ccc6be6
...
@@ -79,6 +79,7 @@ SOFTWARE.
...
@@ -79,6 +79,7 @@ SOFTWARE.
#include <signal.h>
#include <signal.h>
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <unistd.h>
#ifndef WIN32
#ifndef WIN32
#include <sys/socket.h>
#include <sys/socket.h>
...
@@ -364,6 +365,14 @@ NotifyParentProcess(void)
...
@@ -364,6 +365,14 @@ NotifyParentProcess(void)
{
{
#if !defined(WIN32)
#if !defined(WIN32)
if
(
displayfd
>=
0
)
{
if
(
displayfd
>=
0
)
{
#ifdef NXAGENT_SERVER
if
(
displayfd
==
STDERR_FILENO
)
{
const
char
*
msg
=
"Auto-detected display number is: DISPLAY=:"
;
if
(
write
(
displayfd
,
msg
,
strlen
(
msg
))
!=
strlen
(
msg
))
FatalError
(
"Cannot write display number to fd %d
\n
"
,
displayfd
);
}
#endif
if
(
write
(
displayfd
,
display
,
strlen
(
display
))
!=
strlen
(
display
))
if
(
write
(
displayfd
,
display
,
strlen
(
display
))
!=
strlen
(
display
))
FatalError
(
"Cannot write display number to fd %d
\n
"
,
displayfd
);
FatalError
(
"Cannot write display number to fd %d
\n
"
,
displayfd
);
if
(
write
(
displayfd
,
"
\n
"
,
1
)
!=
1
)
if
(
write
(
displayfd
,
"
\n
"
,
1
)
!=
1
)
...
@@ -418,7 +427,11 @@ CreateWellKnownSockets(void)
...
@@ -418,7 +427,11 @@ CreateWellKnownSockets(void)
if
(
NoListenAll
)
{
if
(
NoListenAll
)
{
ListenTransCount
=
0
;
ListenTransCount
=
0
;
}
}
#ifndef NXAGENT_SERVER
else
if
((
displayfd
<
0
)
||
explicit_display
)
{
else
if
((
displayfd
<
0
)
||
explicit_display
)
{
#else
else
if
(
displayfd
<
0
)
{
#endif
/* ! NXAGENT_SERVER */
if
(
TryCreateSocket
(
atoi
(
display
),
&
partial
)
&&
if
(
TryCreateSocket
(
atoi
(
display
),
&
partial
)
&&
ListenTransCount
>=
1
)
ListenTransCount
>=
1
)
if
(
!
PartialNetwork
&&
partial
)
if
(
!
PartialNetwork
&&
partial
)
...
@@ -426,7 +439,14 @@ CreateWellKnownSockets(void)
...
@@ -426,7 +439,14 @@ CreateWellKnownSockets(void)
}
}
else
{
/* -displayfd and no explicit display number */
else
{
/* -displayfd and no explicit display number */
Bool
found
=
0
;
Bool
found
=
0
;
#ifdef NXAGENT_SERVER
int
i_offset
=
0
;
if
(
explicit_display
)
i_offset
=
atoi
(
display
);
for
(
i
=
i_offset
;
i
<
65536
-
X_TCP_PORT
;
i
++
)
{
#else
for
(
i
=
0
;
i
<
65536
-
X_TCP_PORT
;
i
++
)
{
for
(
i
=
0
;
i
<
65536
-
X_TCP_PORT
;
i
++
)
{
#endif
/* NXAGENT_SERVER */
if
(
TryCreateSocket
(
i
,
&
partial
)
&&
!
partial
)
{
if
(
TryCreateSocket
(
i
,
&
partial
)
&&
!
partial
)
{
found
=
1
;
found
=
1
;
break
;
break
;
...
...
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