Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
cdf92942
Commit
cdf92942
authored
Sep 16, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the proper size for the cmsg_fd structure on 64-bit plaforms.
parent
1476116b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
13 deletions
+19
-13
server.c
dlls/ntdll/server.c
+12
-9
request.c
server/request.c
+7
-4
No files found.
dlls/ntdll/server.c
View file @
cdf92942
...
...
@@ -74,9 +74,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(server);
/* data structure used to pass an fd with sendmsg/recvmsg */
struct
cmsg_fd
{
int
len
;
/* size of structure */
struct
{
size_t
len
;
/* size of structure */
int
level
;
/* SOL_SOCKET */
int
type
;
/* SCM_RIGHTS */
}
header
;
int
fd
;
/* fd to pass */
};
#endif
/* HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */
...
...
@@ -339,12 +342,12 @@ void wine_server_send_fd( int fd )
msghdr
.
msg_accrights
=
(
void
*
)
&
fd
;
msghdr
.
msg_accrightslen
=
sizeof
(
fd
);
#else
/* HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */
cmsg
.
len
=
sizeof
(
cmsg
);
cmsg
.
level
=
SOL_SOCKET
;
cmsg
.
type
=
SCM_RIGHTS
;
cmsg
.
header
.
len
=
sizeof
(
cmsg
.
header
)
+
sizeof
(
fd
);
cmsg
.
header
.
level
=
SOL_SOCKET
;
cmsg
.
header
.
type
=
SCM_RIGHTS
;
cmsg
.
fd
=
fd
;
msghdr
.
msg_control
=
&
cmsg
;
msghdr
.
msg_controllen
=
sizeof
(
cmsg
);
msghdr
.
msg_controllen
=
sizeof
(
cmsg
.
header
)
+
sizeof
(
fd
);
msghdr
.
msg_flags
=
0
;
#endif
/* HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */
...
...
@@ -382,12 +385,12 @@ static int receive_fd( obj_handle_t *handle )
struct
msghdr
msghdr
;
struct
cmsg_fd
cmsg
;
cmsg
.
len
=
sizeof
(
cmsg
);
cmsg
.
level
=
SOL_SOCKET
;
cmsg
.
type
=
SCM_RIGHTS
;
cmsg
.
header
.
len
=
sizeof
(
cmsg
.
header
)
+
sizeof
(
fd
);
cmsg
.
header
.
level
=
SOL_SOCKET
;
cmsg
.
header
.
type
=
SCM_RIGHTS
;
cmsg
.
fd
=
-
1
;
msghdr
.
msg_control
=
&
cmsg
;
msghdr
.
msg_controllen
=
sizeof
(
cmsg
);
msghdr
.
msg_controllen
=
sizeof
(
cmsg
.
header
)
+
sizeof
(
fd
);
msghdr
.
msg_flags
=
0
;
#endif
/* HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */
...
...
server/request.c
View file @
cdf92942
...
...
@@ -122,12 +122,15 @@ static struct msghdr msghdr;
#ifndef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
struct
cmsg_fd
{
int
len
;
/* size of structure */
struct
{
size_t
len
;
/* size of structure */
int
level
;
/* SOL_SOCKET */
int
type
;
/* SCM_RIGHTS */
}
header
;
int
fd
;
/* fd to pass */
};
static
struct
cmsg_fd
cmsg
=
{
sizeof
(
cmsg
),
SOL_SOCKET
,
SCM_RIGHTS
,
-
1
};
static
struct
cmsg_fd
cmsg
=
{
{
sizeof
(
cmsg
.
header
)
+
sizeof
(
cmsg
.
fd
),
SOL_SOCKET
,
SCM_RIGHTS
}
,
-
1
};
#endif
/* HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */
/* complain about a protocol error and terminate the client connection */
...
...
@@ -350,7 +353,7 @@ int receive_fd( struct process *process )
msghdr
.
msg_accrights
=
(
void
*
)
&
fd
;
#else
/* HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */
msghdr
.
msg_control
=
&
cmsg
;
msghdr
.
msg_controllen
=
sizeof
(
cmsg
);
msghdr
.
msg_controllen
=
sizeof
(
cmsg
.
header
)
+
sizeof
(
fd
);
cmsg
.
fd
=
-
1
;
#endif
/* HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */
...
...
@@ -420,7 +423,7 @@ int send_client_fd( struct process *process, int fd, obj_handle_t handle )
msghdr
.
msg_accrights
=
(
void
*
)
&
fd
;
#else
/* HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */
msghdr
.
msg_control
=
&
cmsg
;
msghdr
.
msg_controllen
=
sizeof
(
cmsg
);
msghdr
.
msg_controllen
=
sizeof
(
cmsg
.
header
)
+
sizeof
(
fd
);
cmsg
.
fd
=
fd
;
#endif
/* HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */
...
...
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