mirror of
https://github.com/transmission/transmission
synced 2025-03-02 17:55:22 +00:00
Apparently "sun" is a bad choice for a variable name on solaris.
This commit is contained in:
parent
12f377fc6e
commit
4ab0a93807
4 changed files with 21 additions and 21 deletions
|
@ -135,7 +135,7 @@ client_init( struct event_base * base )
|
|||
int
|
||||
client_new_sock( const char * path )
|
||||
{
|
||||
struct sockaddr_un sun;
|
||||
struct sockaddr_un sa;
|
||||
int fd;
|
||||
struct con * con;
|
||||
|
||||
|
@ -145,9 +145,9 @@ client_new_sock( const char * path )
|
|||
|
||||
gl_proxy = 0;
|
||||
|
||||
memset( &sun, 0, sizeof sun );
|
||||
sun.sun_family = AF_LOCAL;
|
||||
strlcpy( sun.sun_path, path, sizeof sun.sun_path );
|
||||
memset( &sa, 0, sizeof sa );
|
||||
sa.sun_family = AF_LOCAL;
|
||||
strlcpy( sa.sun_path, path, sizeof sa.sun_path );
|
||||
|
||||
fd = socket( AF_UNIX, SOCK_STREAM, 0 );
|
||||
if( 0 > fd )
|
||||
|
@ -156,7 +156,7 @@ client_new_sock( const char * path )
|
|||
return -1;
|
||||
}
|
||||
|
||||
if( 0 > connect( fd, ( struct sockaddr * )&sun, SUN_LEN( &sun ) ) )
|
||||
if( 0 > connect( fd, ( struct sockaddr * )&sa, SUN_LEN( &sa ) ) )
|
||||
{
|
||||
errnomsg( "failed to connect to socket file: %s", path );
|
||||
close( fd );
|
||||
|
|
|
@ -252,7 +252,7 @@ getlock( const char * path )
|
|||
int
|
||||
getsock( const char * path )
|
||||
{
|
||||
struct sockaddr_un sun;
|
||||
struct sockaddr_un sa;
|
||||
int fd;
|
||||
|
||||
fd = socket( PF_LOCAL, SOCK_STREAM, 0 );
|
||||
|
@ -262,15 +262,15 @@ getsock( const char * path )
|
|||
return -1;
|
||||
}
|
||||
|
||||
memset( &sun, 0, sizeof sun );
|
||||
sun.sun_family = AF_LOCAL;
|
||||
strlcpy( sun.sun_path, path, sizeof sun.sun_path );
|
||||
memset( &sa, 0, sizeof sa );
|
||||
sa.sun_family = AF_LOCAL;
|
||||
strlcpy( sa.sun_path, path, sizeof sa.sun_path );
|
||||
unlink( path );
|
||||
if( 0 > bind( fd, ( struct sockaddr * )&sun, SUN_LEN( &sun ) ) )
|
||||
if( 0 > bind( fd, ( struct sockaddr * )&sa, SUN_LEN( &sa ) ) )
|
||||
{
|
||||
/* bind can sometimes fail on the first call */
|
||||
unlink( path );
|
||||
if( 0 > bind( fd, ( struct sockaddr * )&sun, SUN_LEN( &sun ) ) )
|
||||
if( 0 > bind( fd, ( struct sockaddr * )&sa, SUN_LEN( &sa ) ) )
|
||||
{
|
||||
errnomsg( "failed to bind socket file: %s", path );
|
||||
close( fd );
|
||||
|
|
|
@ -195,18 +195,18 @@ readargs( int argc, char ** argv, char ** sockpath )
|
|||
int
|
||||
makesock( enum confpathtype type, const char * path )
|
||||
{
|
||||
struct sockaddr_un sun;
|
||||
struct sockaddr_un sa;
|
||||
int fd;
|
||||
|
||||
memset( &sun, 0, sizeof sun );
|
||||
sun.sun_family = AF_LOCAL;
|
||||
memset( &sa, 0, sizeof sa );
|
||||
sa.sun_family = AF_LOCAL;
|
||||
if( NULL == path )
|
||||
{
|
||||
confpath( sun.sun_path, sizeof sun.sun_path, CONF_FILE_SOCKET, type );
|
||||
confpath( sa.sun_path, sizeof sa.sun_path, CONF_FILE_SOCKET, type );
|
||||
}
|
||||
else
|
||||
{
|
||||
strlcpy( sun.sun_path, path, sizeof sun.sun_path );
|
||||
strlcpy( sa.sun_path, path, sizeof sa.sun_path );
|
||||
}
|
||||
|
||||
fd = socket( AF_UNIX, SOCK_STREAM, 0 );
|
||||
|
@ -216,9 +216,9 @@ makesock( enum confpathtype type, const char * path )
|
|||
return -1;
|
||||
}
|
||||
|
||||
if( 0 > connect( fd, ( struct sockaddr * )&sun, SUN_LEN( &sun ) ) )
|
||||
if( 0 > connect( fd, ( struct sockaddr * )&sa, SUN_LEN( &sa ) ) )
|
||||
{
|
||||
errnomsg( "failed to connect to socket file: %s", sun.sun_path );
|
||||
errnomsg( "failed to connect to socket file: %s", sa.sun_path );
|
||||
close( fd );
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -188,7 +188,7 @@ server_listen( int fd )
|
|||
void
|
||||
newclient( int fd, short event UNUSED, void * arg )
|
||||
{
|
||||
struct sockaddr_un sun;
|
||||
struct sockaddr_un sa;
|
||||
struct client * client, * old;
|
||||
socklen_t socklen;
|
||||
struct bufferevent * clev;
|
||||
|
@ -211,8 +211,8 @@ newclient( int fd, short event UNUSED, void * arg )
|
|||
return;
|
||||
}
|
||||
|
||||
socklen = sizeof sun;
|
||||
clfd = accept( fd, ( struct sockaddr * )&sun, &socklen );
|
||||
socklen = sizeof sa;
|
||||
clfd = accept( fd, ( struct sockaddr * )&sa, &socklen );
|
||||
if( 0 > clfd )
|
||||
{
|
||||
if( EWOULDBLOCK != errno && EAGAIN != errno &&
|
||||
|
|
Loading…
Reference in a new issue