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
0eb1dc67
Commit
0eb1dc67
authored
Dec 10, 2017
by
Ulrich Sibiller
Committed by
Mike Gabriel
Dec 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Xtranssock.c: simplify code in SocketWritev
Code was here twice and could be simply merged.
parent
4988e7c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
44 deletions
+0
-44
Xtranssock.c
nx-X11/lib/include/xtrans/Xtranssock.c
+0
-44
No files found.
nx-X11/lib/include/xtrans/Xtranssock.c
View file @
0eb1dc67
...
...
@@ -2874,48 +2874,7 @@ TRANS(SocketWritev) (XtransConnInfo ciptr, struct iovec *buf, int size)
{
return
NXTransWriteVector
(
ciptr
->
fd
,
buf
,
size
);
}
else
{
/* FIXME: same code as below, should be possible without duplication */
#if XTRANS_SEND_FDS
if
(
ciptr
->
send_fds
)
{
union
fd_pass
cmsgbuf
;
int
nfd
=
nFd
(
&
ciptr
->
send_fds
);
struct
_XtransConnFd
*
cf
=
ciptr
->
send_fds
;
struct
msghdr
msg
=
{
.
msg_name
=
NULL
,
.
msg_namelen
=
0
,
.
msg_iov
=
buf
,
.
msg_iovlen
=
size
,
.
msg_control
=
cmsgbuf
.
buf
,
.
msg_controllen
=
CMSG_LEN
(
nfd
*
sizeof
(
int
))
};
struct
cmsghdr
*
hdr
=
CMSG_FIRSTHDR
(
&
msg
);
int
i
;
int
*
fds
;
hdr
->
cmsg_len
=
msg
.
msg_controllen
;
hdr
->
cmsg_level
=
SOL_SOCKET
;
hdr
->
cmsg_type
=
SCM_RIGHTS
;
fds
=
(
int
*
)
CMSG_DATA
(
hdr
);
/* Set up fds */
for
(
i
=
0
;
i
<
nfd
;
i
++
)
{
fds
[
i
]
=
cf
->
fd
;
cf
=
cf
->
next
;
}
i
=
sendmsg
(
ciptr
->
fd
,
&
msg
,
0
);
if
(
i
>
0
)
discardFd
(
&
ciptr
->
send_fds
,
cf
,
0
);
return
i
;
}
#endif
return
WRITEV
(
ciptr
,
buf
,
size
);
}
#else
/* #if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) */
#if XTRANS_SEND_FDS
if
(
ciptr
->
send_fds
)
...
...
@@ -2953,11 +2912,8 @@ TRANS(SocketWritev) (XtransConnInfo ciptr, struct iovec *buf, int size)
}
#endif
return
WRITEV
(
ciptr
,
buf
,
size
);
#endif
/* #if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT) */
}
static
int
TRANS
(
SocketWrite
)
(
XtransConnInfo
ciptr
,
char
*
buf
,
int
size
)
...
...
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