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
3066195d
Commit
3066195d
authored
Dec 27, 2017
by
Ulrich Sibiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Loop.cpp: some reformatting/simplification/FIXMEs
(partially) fixes ArcticaProject/nx-libs#612
parent
c31c54c1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
Loop.cpp
nxcomp/src/Loop.cpp
+11
-5
No files found.
nxcomp/src/Loop.cpp
View file @
3066195d
...
...
@@ -3861,7 +3861,8 @@ void SetupDisplaySocket(int &addr_family, sockaddr *&addr,
#ifdef __APPLE__
if
((
strncasecmp
(
display
,
"/tmp/launch"
,
11
)
==
0
)
||
(
strncasecmp
(
display
,
"/private/tmp/com.apple.launchd"
,
30
)
==
0
))
if
((
strncasecmp
(
display
,
"/tmp/launch"
,
11
)
==
0
)
||
(
strncasecmp
(
display
,
"/private/tmp/com.apple.launchd"
,
30
)
==
0
))
{
nxinfo
<<
"Loop: Using launchd service on socket '"
<<
display
<<
"'.
\n
"
<<
std
::
flush
;
...
...
@@ -3934,19 +3935,24 @@ void SetupDisplaySocket(int &addr_family, sockaddr *&addr,
// fall back to Unix domain socket file.
#ifdef __linux__
int
testSocketFD
;
testSocketFD
=
socket
(
addr_family
,
SOCK_STREAM
,
PF_UNSPEC
);
int
testSocketFD
=
socket
(
addr_family
,
SOCK_STREAM
,
PF_UNSPEC
);
// this name cannot be changed as it is defined this way by the
// local X server
int
len
=
sprintf
(
unixSocketName
+
1
,
"/tmp/.X11-unix/X%d"
,
xPort
);
unixSocketName
[
0
]
=
'\0'
;
sockaddr_un
*
xServerAddrABSTRACT
=
new
sockaddr_un
;
memset
(
xServerAddrABSTRACT
,
0
,
sizeof
(
struct
sockaddr_un
));
xServerAddrABSTRACT
->
sun_family
=
AF_UNIX
;
// FIXME: ensure sun_path can hold len+1 bytes!
memcpy
(
xServerAddrABSTRACT
->
sun_path
,
unixSocketName
,
len
+
1
);
addr_length
=
len
+
3
;
// FIXME: comment why + 3?
addr_length
=
len
+
3
;
int
ret
=
connect
(
testSocketFD
,
(
struct
sockaddr
*
)
xServerAddrABSTRACT
,
addr_length
);
int
ret
=
connect
(
testSocketFD
,
(
struct
sockaddr
*
)
xServerAddrABSTRACT
,
addr_length
);
close
(
testSocketFD
);
if
(
ret
==
0
)
{
...
...
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