Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5537dbbf
Commit
5537dbbf
authored
Mar 28, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced WINE_CHECK_STRUCT_MEMBER autoconf macro by the standard
AC_CHECK_MEMBERS. Added check for si_fd in siginfo_t.
parent
d56f063c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
59 additions
and
96 deletions
+59
-96
aclocal.m4
aclocal.m4
+0
-10
configure
configure
+0
-0
configure.ac
configure.ac
+9
-41
netapi32.c
dlls/netapi32/netapi32.c
+2
-2
rpcrt4_main.c
dlls/rpcrt4/rpcrt4_main.c
+2
-2
socket.c
dlls/winsock/socket.c
+2
-2
drive.c
files/drive.c
+2
-2
config.h.in
include/config.h.in
+18
-15
port.h
include/wine/port.h
+1
-1
client.c
scheduler/client.c
+11
-11
request.c
server/request.c
+10
-10
signal.c
server/signal.c
+2
-0
No files found.
aclocal.m4
View file @
5537dbbf
...
@@ -50,16 +50,6 @@ then AC_DEFINE_UNQUOTED(AS_TR_CPP(SONAME_LIB$1),"$ac_cv_lib_soname_$1",
...
@@ -50,16 +50,6 @@ then AC_DEFINE_UNQUOTED(AS_TR_CPP(SONAME_LIB$1),"$ac_cv_lib_soname_$1",
[Define to the soname of the lib$1 library.])dnl
[Define to the soname of the lib$1 library.])dnl
fi])
fi])
dnl **** Check if a structure contains a specified member ****
dnl
dnl Usage: WINE_CHECK_STRUCT_MEMBER(struct,member,[includes,[action-if-found,[action-if-not-found]]])
dnl
AC_DEFUN([WINE_CHECK_STRUCT_MEMBER],
[AC_CACHE_CHECK([for $2 in struct $1], ac_cv_c_$1_$2,
AC_TRY_COMPILE([$3],[struct $1 s; s.$2 = 0],ac_cv_c_$1_$2="yes",ac_cv_c_$1_$2="no"))
AS_IF([ test "x$ac_cv_c_$1_$2" = "xyes"],[$4],[$5])
])
dnl **** Check for reentrant libc ****
dnl **** Check for reentrant libc ****
dnl
dnl
dnl Usage: WINE_CHECK_ERRNO(errno-name,[action-if-yes,[action-if-no]])
dnl Usage: WINE_CHECK_ERRNO(errno-name,[action-if-yes,[action-if-no]])
...
...
configure
View file @
5537dbbf
This diff is collapsed.
Click to expand it.
configure.ac
View file @
5537dbbf
...
@@ -1294,7 +1294,8 @@ fi
...
@@ -1294,7 +1294,8 @@ fi
dnl **** FIXME: what about mixed cases, where we need two of them? ***
dnl **** FIXME: what about mixed cases, where we need two of them? ***
WINE_CHECK_STRUCT_MEMBER(statfs,f_bfree,
dnl Check for statfs members
AC_CHECK_MEMBERS([struct statfs.f_bfree, struct statfs.f_bavail],,,
[#include <sys/types.h>
[#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
# include <sys/param.h>
...
@@ -1309,53 +1310,20 @@ WINE_CHECK_STRUCT_MEMBER(statfs,f_bfree,
...
@@ -1309,53 +1310,20 @@ WINE_CHECK_STRUCT_MEMBER(statfs,f_bfree,
# include <sys/statfs.h>
# include <sys/statfs.h>
# endif
# endif
# endif
# endif
#endif],
#endif])
[AC_DEFINE(STATFS_HAS_BFREE, 1, [Define if the struct statfs has the member bfree])])
WINE_CHECK_STRUCT_MEMBER(statfs,f_bavail,
dnl Check for socket structure members
[#include <sys/types.h>
AC_CHECK_MEMBERS([struct msghdr.msg_accrights, struct sockaddr.sa_len, struct sockaddr_un.sun_len],,,
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef STATFS_DEFINED_BY_SYS_MOUNT
# include <sys/mount.h>
#else
# ifdef STATFS_DEFINED_BY_SYS_VFS
# include <sys/vfs.h>
# else
# ifdef STATFS_DEFINED_BY_SYS_STATFS
# include <sys/statfs.h>
# endif
# endif
#endif],
[AC_DEFINE(STATFS_HAS_BAVAIL, 1, [Define if the struct statfs has the member bavail])])
dnl Check for file descriptor passing with msg_accrights
WINE_CHECK_STRUCT_MEMBER(msghdr,msg_accrights,
[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif],
[AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS, 1, [Define if struct msghdr contains msg_accrights])])
dnl Check for the sa_len member in struct sockaddr
WINE_CHECK_STRUCT_MEMBER(sockaddr,sa_len,
[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif],
[AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if struct sockaddr contains sa_len])])
dnl Check for the sun_len member in struct sockaddr_un
WINE_CHECK_STRUCT_MEMBER(sockaddr_un,sun_len,
[#include <sys/types.h>
[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
# include <sys/socket.h>
#endif
#endif
#ifdef HAVE_SYS_UN_H
#ifdef HAVE_SYS_UN_H
# include <sys/un.h>
# include <sys/un.h>
#endif],
#endif])
[AC_DEFINE(HAVE_SOCKADDR_SUN_LEN, 1, [Define if struct sockaddr_un contains sun_len])])
dnl Check for siginfo_t members
AC_CHECK_MEMBERS([siginfo_t.si_fd],,,[#include <signal.h>])
dnl *** check for the need to define platform-specific symbols
dnl *** check for the need to define platform-specific symbols
...
...
dlls/netapi32/netapi32.c
View file @
5537dbbf
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
# include <netinet/in.h>
# include <netinet/in.h>
#endif
#endif
#ifdef HAVE_SOCKADDR_SA_LEN
#ifdef HAVE_S
TRUCT_S
OCKADDR_SA_LEN
# ifndef max
# ifndef max
# define max(a,b) ((a) > (b) ? (a) : (b))
# define max(a,b) ((a) > (b) ? (a) : (b))
# endif
# endif
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
sizeof((i).ifr_name)+(i).ifr_addr.sa_len)
sizeof((i).ifr_name)+(i).ifr_addr.sa_len)
# else
# else
# define ifreq_size(i) sizeof(struct ifreq)
# define ifreq_size(i) sizeof(struct ifreq)
# endif
/*
defined(HAVE_SOCKADDR_SA_LEN)
*/
# endif
/*
HAVE_STRUCT_SOCKADDR_SA_LEN
*/
WINE_DEFAULT_DEBUG_CHANNEL
(
netbios
);
WINE_DEFAULT_DEBUG_CHANNEL
(
netbios
);
...
...
dlls/rpcrt4/rpcrt4_main.c
View file @
5537dbbf
...
@@ -338,7 +338,7 @@ RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
...
@@ -338,7 +338,7 @@ RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
* However, under earlier systems, sa_len isn't present, so
* However, under earlier systems, sa_len isn't present, so
* the size is just sizeof(struct ifreq)
* the size is just sizeof(struct ifreq)
*/
*/
#ifdef HAVE_SOCKADDR_SA_LEN
#ifdef HAVE_S
TRUCT_S
OCKADDR_SA_LEN
# ifndef max
# ifndef max
# define max(a,b) ((a) > (b) ? (a) : (b))
# define max(a,b) ((a) > (b) ? (a) : (b))
# endif
# endif
...
@@ -346,7 +346,7 @@ RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
...
@@ -346,7 +346,7 @@ RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
sizeof((i).ifr_name)+(i).ifr_addr.sa_len)
sizeof((i).ifr_name)+(i).ifr_addr.sa_len)
# else
# else
# define ifreq_size(i) sizeof(struct ifreq)
# define ifreq_size(i) sizeof(struct ifreq)
# endif
/*
defined(HAVE_SOCKADDR_SA_LEN)
*/
# endif
/*
HAVE_STRUCT_SOCKADDR_SA_LEN
*/
sd
=
socket
(
AF_INET
,
SOCK_DGRAM
,
IPPROTO_IP
);
sd
=
socket
(
AF_INET
,
SOCK_DGRAM
,
IPPROTO_IP
);
if
(
sd
<
0
)
{
if
(
sd
<
0
)
{
...
...
dlls/winsock/socket.c
View file @
5537dbbf
...
@@ -1150,7 +1150,7 @@ static int WS2_recv ( int fd, struct iovec* iov, int count,
...
@@ -1150,7 +1150,7 @@ static int WS2_recv ( int fd, struct iovec* iov, int count,
hdr
.
msg_iov
=
iov
;
hdr
.
msg_iov
=
iov
;
hdr
.
msg_iovlen
=
count
;
hdr
.
msg_iovlen
=
count
;
#ifdef HAVE_
MSGHDR
_ACCRIGHTS
#ifdef HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS
hdr
.
msg_accrights
=
NULL
;
hdr
.
msg_accrights
=
NULL
;
hdr
.
msg_accrightslen
=
0
;
hdr
.
msg_accrightslen
=
0
;
#else
#else
...
@@ -1259,7 +1259,7 @@ static int WS2_send ( int fd, struct iovec* iov, int count,
...
@@ -1259,7 +1259,7 @@ static int WS2_send ( int fd, struct iovec* iov, int count,
hdr
.
msg_iov
=
iov
;
hdr
.
msg_iov
=
iov
;
hdr
.
msg_iovlen
=
count
;
hdr
.
msg_iovlen
=
count
;
#ifdef HAVE_
MSGHDR
_ACCRIGHTS
#ifdef HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS
hdr
.
msg_accrights
=
NULL
;
hdr
.
msg_accrights
=
NULL
;
hdr
.
msg_accrightslen
=
0
;
hdr
.
msg_accrightslen
=
0
;
#else
#else
...
...
files/drive.c
View file @
5537dbbf
...
@@ -1314,10 +1314,10 @@ static int DRIVE_GetFreeSpace( int drive, PULARGE_INTEGER size,
...
@@ -1314,10 +1314,10 @@ static int DRIVE_GetFreeSpace( int drive, PULARGE_INTEGER size,
}
}
size
->
QuadPart
=
RtlEnlargedUnsignedMultiply
(
info
.
f_bsize
,
info
.
f_blocks
);
size
->
QuadPart
=
RtlEnlargedUnsignedMultiply
(
info
.
f_bsize
,
info
.
f_blocks
);
#ifdef
STATFS_HAS
_BAVAIL
#ifdef
HAVE_STRUCT_STATFS_F
_BAVAIL
available
->
QuadPart
=
RtlEnlargedUnsignedMultiply
(
info
.
f_bavail
,
info
.
f_bsize
);
available
->
QuadPart
=
RtlEnlargedUnsignedMultiply
(
info
.
f_bavail
,
info
.
f_bsize
);
#else
#else
# ifdef
STATFS_HAS
_BFREE
# ifdef
HAVE_STRUCT_STATFS_F
_BFREE
available
->
QuadPart
=
RtlEnlargedUnsignedMultiply
(
info
.
f_bfree
,
info
.
f_bsize
);
available
->
QuadPart
=
RtlEnlargedUnsignedMultiply
(
info
.
f_bfree
,
info
.
f_bsize
);
# else
# else
# error "statfs has no bfree/bavail member!"
# error "statfs has no bfree/bavail member!"
...
...
include/config.h.in
View file @
5537dbbf
...
@@ -320,9 +320,6 @@
...
@@ -320,9 +320,6 @@
/* Define to 1 if the system has the type `mode_t'. */
/* Define to 1 if the system has the type `mode_t'. */
#undef HAVE_MODE_T
#undef HAVE_MODE_T
/* Define if struct msghdr contains msg_accrights */
#undef HAVE_MSGHDR_ACCRIGHTS
/* Define if you have NAS including devel headers */
/* Define if you have NAS including devel headers */
#undef HAVE_NAS
#undef HAVE_NAS
...
@@ -431,18 +428,15 @@
...
@@ -431,18 +428,15 @@
/* Define to 1 if you have the `sigaltstack' function. */
/* Define to 1 if you have the `sigaltstack' function. */
#undef HAVE_SIGALTSTACK
#undef HAVE_SIGALTSTACK
/* Define to 1 if `si_fd' is member of `siginfo_t'. */
#undef HAVE_SIGINFO_T_SI_FD
/* Define to 1 if the system has the type `size_t'. */
/* Define to 1 if the system has the type `size_t'. */
#undef HAVE_SIZE_T
#undef HAVE_SIZE_T
/* Define to 1 if you have the `snprintf' function. */
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
#undef HAVE_SNPRINTF
/* Define if struct sockaddr contains sa_len */
#undef HAVE_SOCKADDR_SA_LEN
/* Define if struct sockaddr_un contains sun_len */
#undef HAVE_SOCKADDR_SUN_LEN
/* Define to 1 if you have the <socket.h> header file. */
/* Define to 1 if you have the <socket.h> header file. */
#undef HAVE_SOCKET_H
#undef HAVE_SOCKET_H
...
@@ -476,6 +470,21 @@
...
@@ -476,6 +470,21 @@
/* Define to 1 if you have the `strncasecmp' function. */
/* Define to 1 if you have the `strncasecmp' function. */
#undef HAVE_STRNCASECMP
#undef HAVE_STRNCASECMP
/* Define to 1 if `msg_accrights' is member of `struct msghdr'. */
#undef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
/* Define to 1 if `sa_len' is member of `struct sockaddr'. */
#undef HAVE_STRUCT_SOCKADDR_SA_LEN
/* Define to 1 if `sun_len' is member of `struct sockaddr_un'. */
#undef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
/* Define to 1 if `f_bavail' is member of `struct statfs'. */
#undef HAVE_STRUCT_STATFS_F_BAVAIL
/* Define to 1 if `f_bfree' is member of `struct statfs'. */
#undef HAVE_STRUCT_STATFS_F_BFREE
/* Define to 1 if you have the <syscall.h> header file. */
/* Define to 1 if you have the <syscall.h> header file. */
#undef HAVE_SYSCALL_H
#undef HAVE_SYSCALL_H
...
@@ -751,12 +760,6 @@
...
@@ -751,12 +760,6 @@
/* Define if the struct statfs is defined by <sys/vfs.h> */
/* Define if the struct statfs is defined by <sys/vfs.h> */
#undef STATFS_DEFINED_BY_SYS_VFS
#undef STATFS_DEFINED_BY_SYS_VFS
/* Define if the struct statfs has the member bavail */
#undef STATFS_HAS_BAVAIL
/* Define if the struct statfs has the member bfree */
#undef STATFS_HAS_BFREE
/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
#undef STAT_MACROS_BROKEN
#undef STAT_MACROS_BROKEN
...
...
include/wine/port.h
View file @
5537dbbf
...
@@ -63,7 +63,7 @@ typedef int ssize_t;
...
@@ -63,7 +63,7 @@ typedef int ssize_t;
#ifndef HAVE_STATFS
#ifndef HAVE_STATFS
# ifdef __BEOS__
# ifdef __BEOS__
# define
STATFS_HAS
_BFREE
# define
HAVE_STRUCT_STATFS_F
_BFREE
struct
statfs
{
struct
statfs
{
long
f_bsize
;
/* block_size */
long
f_bsize
;
/* block_size */
long
f_blocks
;
/* total_blocks */
long
f_blocks
;
/* total_blocks */
...
...
scheduler/client.c
View file @
5537dbbf
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
#define SOCKETNAME "socket"
/* name of the socket file */
#define SOCKETNAME "socket"
/* name of the socket file */
#define LOCKNAME "lock"
/* name of the lock file */
#define LOCKNAME "lock"
/* name of the lock file */
#ifndef HAVE_
MSGHDR
_ACCRIGHTS
#ifndef HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS
/* data structure used to pass an fd with sendmsg/recvmsg */
/* data structure used to pass an fd with sendmsg/recvmsg */
struct
cmsg_fd
struct
cmsg_fd
{
{
...
@@ -73,7 +73,7 @@ struct cmsg_fd
...
@@ -73,7 +73,7 @@ struct cmsg_fd
int
type
;
/* SCM_RIGHTS */
int
type
;
/* SCM_RIGHTS */
int
fd
;
/* fd to pass */
int
fd
;
/* fd to pass */
};
};
#endif
/* HAVE_
MSGHDR
_ACCRIGHTS */
#endif
/* HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS */
static
DWORD
boot_thread_id
;
static
DWORD
boot_thread_id
;
static
sigset_t
block_set
;
/* signals to block during server calls */
static
sigset_t
block_set
;
/* signals to block during server calls */
...
@@ -238,7 +238,7 @@ unsigned int wine_server_call( void *req_ptr )
...
@@ -238,7 +238,7 @@ unsigned int wine_server_call( void *req_ptr )
*/
*/
void
wine_server_send_fd
(
int
fd
)
void
wine_server_send_fd
(
int
fd
)
{
{
#ifndef HAVE_
MSGHDR
_ACCRIGHTS
#ifndef HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS
struct
cmsg_fd
cmsg
;
struct
cmsg_fd
cmsg
;
#endif
#endif
struct
send_fd
data
;
struct
send_fd
data
;
...
@@ -254,10 +254,10 @@ void wine_server_send_fd( int fd )
...
@@ -254,10 +254,10 @@ void wine_server_send_fd( int fd )
msghdr
.
msg_iov
=
&
vec
;
msghdr
.
msg_iov
=
&
vec
;
msghdr
.
msg_iovlen
=
1
;
msghdr
.
msg_iovlen
=
1
;
#ifdef HAVE_
MSGHDR
_ACCRIGHTS
#ifdef HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS
msghdr
.
msg_accrights
=
(
void
*
)
&
fd
;
msghdr
.
msg_accrights
=
(
void
*
)
&
fd
;
msghdr
.
msg_accrightslen
=
sizeof
(
fd
);
msghdr
.
msg_accrightslen
=
sizeof
(
fd
);
#else
/* HAVE_
MSGHDR
_ACCRIGHTS */
#else
/* HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS */
cmsg
.
len
=
sizeof
(
cmsg
);
cmsg
.
len
=
sizeof
(
cmsg
);
cmsg
.
level
=
SOL_SOCKET
;
cmsg
.
level
=
SOL_SOCKET
;
cmsg
.
type
=
SCM_RIGHTS
;
cmsg
.
type
=
SCM_RIGHTS
;
...
@@ -265,7 +265,7 @@ void wine_server_send_fd( int fd )
...
@@ -265,7 +265,7 @@ void wine_server_send_fd( int fd )
msghdr
.
msg_control
=
&
cmsg
;
msghdr
.
msg_control
=
&
cmsg
;
msghdr
.
msg_controllen
=
sizeof
(
cmsg
);
msghdr
.
msg_controllen
=
sizeof
(
cmsg
);
msghdr
.
msg_flags
=
0
;
msghdr
.
msg_flags
=
0
;
#endif
/* HAVE_
MSGHDR
_ACCRIGHTS */
#endif
/* HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS */
data
.
tid
=
GetCurrentThreadId
();
data
.
tid
=
GetCurrentThreadId
();
data
.
fd
=
fd
;
data
.
fd
=
fd
;
...
@@ -291,13 +291,13 @@ static int receive_fd( obj_handle_t *handle )
...
@@ -291,13 +291,13 @@ static int receive_fd( obj_handle_t *handle )
struct
iovec
vec
;
struct
iovec
vec
;
int
ret
,
fd
;
int
ret
,
fd
;
#ifdef HAVE_
MSGHDR
_ACCRIGHTS
#ifdef HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS
struct
msghdr
msghdr
;
struct
msghdr
msghdr
;
fd
=
-
1
;
fd
=
-
1
;
msghdr
.
msg_accrights
=
(
void
*
)
&
fd
;
msghdr
.
msg_accrights
=
(
void
*
)
&
fd
;
msghdr
.
msg_accrightslen
=
sizeof
(
fd
);
msghdr
.
msg_accrightslen
=
sizeof
(
fd
);
#else
/* HAVE_
MSGHDR
_ACCRIGHTS */
#else
/* HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS */
struct
msghdr
msghdr
;
struct
msghdr
msghdr
;
struct
cmsg_fd
cmsg
;
struct
cmsg_fd
cmsg
;
...
@@ -308,7 +308,7 @@ static int receive_fd( obj_handle_t *handle )
...
@@ -308,7 +308,7 @@ static int receive_fd( obj_handle_t *handle )
msghdr
.
msg_control
=
&
cmsg
;
msghdr
.
msg_control
=
&
cmsg
;
msghdr
.
msg_controllen
=
sizeof
(
cmsg
);
msghdr
.
msg_controllen
=
sizeof
(
cmsg
);
msghdr
.
msg_flags
=
0
;
msghdr
.
msg_flags
=
0
;
#endif
/* HAVE_
MSGHDR
_ACCRIGHTS */
#endif
/* HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS */
msghdr
.
msg_name
=
NULL
;
msghdr
.
msg_name
=
NULL
;
msghdr
.
msg_namelen
=
0
;
msghdr
.
msg_namelen
=
0
;
...
@@ -321,7 +321,7 @@ static int receive_fd( obj_handle_t *handle )
...
@@ -321,7 +321,7 @@ static int receive_fd( obj_handle_t *handle )
{
{
if
((
ret
=
recvmsg
(
fd_socket
,
&
msghdr
,
0
))
>
0
)
if
((
ret
=
recvmsg
(
fd_socket
,
&
msghdr
,
0
))
>
0
)
{
{
#ifndef HAVE_
MSGHDR
_ACCRIGHTS
#ifndef HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS
fd
=
cmsg
.
fd
;
fd
=
cmsg
.
fd
;
#endif
#endif
if
(
fd
==
-
1
)
server_protocol_error
(
"no fd received for handle %d
\n
"
,
*
handle
);
if
(
fd
==
-
1
)
server_protocol_error
(
"no fd received for handle %d
\n
"
,
*
handle
);
...
@@ -586,7 +586,7 @@ static int server_connect( const char *oldcwd, const char *serverdir )
...
@@ -586,7 +586,7 @@ static int server_connect( const char *oldcwd, const char *serverdir )
addr
.
sun_family
=
AF_UNIX
;
addr
.
sun_family
=
AF_UNIX
;
strcpy
(
addr
.
sun_path
,
SOCKETNAME
);
strcpy
(
addr
.
sun_path
,
SOCKETNAME
);
slen
=
sizeof
(
addr
)
-
sizeof
(
addr
.
sun_path
)
+
strlen
(
addr
.
sun_path
)
+
1
;
slen
=
sizeof
(
addr
)
-
sizeof
(
addr
.
sun_path
)
+
strlen
(
addr
.
sun_path
)
+
1
;
#ifdef HAVE_S
OCKADDR
_SUN_LEN
#ifdef HAVE_S
TRUCT_SOCKADDR_UN
_SUN_LEN
addr
.
sun_len
=
slen
;
addr
.
sun_len
=
slen
;
#endif
#endif
if
((
s
=
socket
(
AF_UNIX
,
SOCK_STREAM
,
0
))
==
-
1
)
fatal_perror
(
"socket"
);
if
((
s
=
socket
(
AF_UNIX
,
SOCK_STREAM
,
0
))
==
-
1
)
fatal_perror
(
"socket"
);
...
...
server/request.c
View file @
5537dbbf
...
@@ -113,7 +113,7 @@ static struct master_socket *master_socket; /* the master socket object */
...
@@ -113,7 +113,7 @@ static struct master_socket *master_socket; /* the master socket object */
/* socket communication static structures */
/* socket communication static structures */
static
struct
iovec
myiovec
;
static
struct
iovec
myiovec
;
static
struct
msghdr
msghdr
;
static
struct
msghdr
msghdr
;
#ifndef HAVE_
MSGHDR
_ACCRIGHTS
#ifndef HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS
struct
cmsg_fd
struct
cmsg_fd
{
{
int
len
;
/* sizeof structure */
int
len
;
/* sizeof structure */
...
@@ -122,7 +122,7 @@ struct cmsg_fd
...
@@ -122,7 +122,7 @@ struct cmsg_fd
int
fd
;
/* fd to pass */
int
fd
;
/* fd to pass */
};
};
static
struct
cmsg_fd
cmsg
=
{
sizeof
(
cmsg
),
SOL_SOCKET
,
SCM_RIGHTS
,
-
1
};
static
struct
cmsg_fd
cmsg
=
{
sizeof
(
cmsg
),
SOL_SOCKET
,
SCM_RIGHTS
,
-
1
};
#endif
/* HAVE_
MSGHDR
_ACCRIGHTS */
#endif
/* HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS */
/* complain about a protocol error and terminate the client connection */
/* complain about a protocol error and terminate the client connection */
void
fatal_protocol_error
(
struct
thread
*
thread
,
const
char
*
err
,
...
)
void
fatal_protocol_error
(
struct
thread
*
thread
,
const
char
*
err
,
...
)
...
@@ -335,20 +335,20 @@ int receive_fd( struct process *process )
...
@@ -335,20 +335,20 @@ int receive_fd( struct process *process )
struct
send_fd
data
;
struct
send_fd
data
;
int
fd
,
ret
;
int
fd
,
ret
;
#ifdef HAVE_
MSGHDR
_ACCRIGHTS
#ifdef HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS
msghdr
.
msg_accrightslen
=
sizeof
(
int
);
msghdr
.
msg_accrightslen
=
sizeof
(
int
);
msghdr
.
msg_accrights
=
(
void
*
)
&
fd
;
msghdr
.
msg_accrights
=
(
void
*
)
&
fd
;
#else
/* HAVE_
MSGHDR
_ACCRIGHTS */
#else
/* HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS */
msghdr
.
msg_control
=
&
cmsg
;
msghdr
.
msg_control
=
&
cmsg
;
msghdr
.
msg_controllen
=
sizeof
(
cmsg
);
msghdr
.
msg_controllen
=
sizeof
(
cmsg
);
cmsg
.
fd
=
-
1
;
cmsg
.
fd
=
-
1
;
#endif
/* HAVE_
MSGHDR
_ACCRIGHTS */
#endif
/* HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS */
myiovec
.
iov_base
=
(
void
*
)
&
data
;
myiovec
.
iov_base
=
(
void
*
)
&
data
;
myiovec
.
iov_len
=
sizeof
(
data
);
myiovec
.
iov_len
=
sizeof
(
data
);
ret
=
recvmsg
(
get_unix_fd
(
process
->
msg_fd
),
&
msghdr
,
0
);
ret
=
recvmsg
(
get_unix_fd
(
process
->
msg_fd
),
&
msghdr
,
0
);
#ifndef HAVE_
MSGHDR
_ACCRIGHTS
#ifndef HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS
fd
=
cmsg
.
fd
;
fd
=
cmsg
.
fd
;
#endif
#endif
...
@@ -405,14 +405,14 @@ int send_client_fd( struct process *process, int fd, obj_handle_t handle )
...
@@ -405,14 +405,14 @@ int send_client_fd( struct process *process, int fd, obj_handle_t handle )
fprintf
(
stderr
,
"%04x: *fd* %p -> %d
\n
"
,
fprintf
(
stderr
,
"%04x: *fd* %p -> %d
\n
"
,
current
?
current
->
id
:
process
->
id
,
handle
,
fd
);
current
?
current
->
id
:
process
->
id
,
handle
,
fd
);
#ifdef HAVE_
MSGHDR
_ACCRIGHTS
#ifdef HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS
msghdr
.
msg_accrightslen
=
sizeof
(
fd
);
msghdr
.
msg_accrightslen
=
sizeof
(
fd
);
msghdr
.
msg_accrights
=
(
void
*
)
&
fd
;
msghdr
.
msg_accrights
=
(
void
*
)
&
fd
;
#else
/* HAVE_
MSGHDR
_ACCRIGHTS */
#else
/* HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS */
msghdr
.
msg_control
=
&
cmsg
;
msghdr
.
msg_control
=
&
cmsg
;
msghdr
.
msg_controllen
=
sizeof
(
cmsg
);
msghdr
.
msg_controllen
=
sizeof
(
cmsg
);
cmsg
.
fd
=
fd
;
cmsg
.
fd
=
fd
;
#endif
/* HAVE_
MSGHDR
_ACCRIGHTS */
#endif
/* HAVE_
STRUCT_MSGHDR_MSG
_ACCRIGHTS */
myiovec
.
iov_base
=
(
void
*
)
&
handle
;
myiovec
.
iov_base
=
(
void
*
)
&
handle
;
myiovec
.
iov_len
=
sizeof
(
handle
);
myiovec
.
iov_len
=
sizeof
(
handle
);
...
@@ -678,7 +678,7 @@ static void acquire_lock(void)
...
@@ -678,7 +678,7 @@ static void acquire_lock(void)
addr
.
sun_family
=
AF_UNIX
;
addr
.
sun_family
=
AF_UNIX
;
strcpy
(
addr
.
sun_path
,
server_socket_name
);
strcpy
(
addr
.
sun_path
,
server_socket_name
);
slen
=
sizeof
(
addr
)
-
sizeof
(
addr
.
sun_path
)
+
strlen
(
addr
.
sun_path
)
+
1
;
slen
=
sizeof
(
addr
)
-
sizeof
(
addr
.
sun_path
)
+
strlen
(
addr
.
sun_path
)
+
1
;
#ifdef HAVE_S
OCKADDR
_SUN_LEN
#ifdef HAVE_S
TRUCT_SOCKADDR_UN
_SUN_LEN
addr
.
sun_len
=
slen
;
addr
.
sun_len
=
slen
;
#endif
#endif
if
(
bind
(
fd
,
(
struct
sockaddr
*
)
&
addr
,
slen
)
==
-
1
)
if
(
bind
(
fd
,
(
struct
sockaddr
*
)
&
addr
,
slen
)
==
-
1
)
...
...
server/signal.c
View file @
5537dbbf
...
@@ -198,7 +198,9 @@ static void do_sigchld()
...
@@ -198,7 +198,9 @@ static void do_sigchld()
static
void
do_sigio
(
int
signum
,
siginfo_t
*
si
,
void
*
x
)
static
void
do_sigio
(
int
signum
,
siginfo_t
*
si
,
void
*
x
)
{
{
do_signal
(
handler_sigio
);
do_signal
(
handler_sigio
);
#ifdef HAVE_SIGINFO_T_SI_FD
do_change_notify
(
si
->
si_fd
);
do_change_notify
(
si
->
si_fd
);
#endif
}
}
void
init_signals
(
void
)
void
init_signals
(
void
)
...
...
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