mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 05:27:44 +00:00
STABLE14-aix-unix-sockets-fix-200803221
LICENSE IPL10 FIXES 88088 use aix's macro for the size of sockaddr_un (cherry picked from commit 493afd1e59661e64120a8d655d6503ac396ca46b)
This commit is contained in:
parent
85a0ec50a5
commit
8079d39afb
@ -162,6 +162,17 @@ extern int LogLevel;
|
||||
*/
|
||||
struct Lock FSYNC_handler_lock;
|
||||
|
||||
|
||||
/*
|
||||
* On AIX, connect() and bind() require use of SUN_LEN() macro;
|
||||
* sizeof(struct sockaddr_un) will not suffice.
|
||||
*/
|
||||
#if defined(AFS_AIX_ENV) && defined(USE_UNIX_SOCKETS)
|
||||
#define AFS_SOCKADDR_LEN(sa) SUN_LEN(sa)
|
||||
#else
|
||||
#define AFS_SOCKADDR_LEN(sa) sizeof(*sa)
|
||||
#endif
|
||||
|
||||
int
|
||||
FSYNC_clientInit(int f)
|
||||
{
|
||||
@ -177,7 +188,7 @@ FSYNC_clientInit(int f)
|
||||
|
||||
for (;;) {
|
||||
FS_sd = getport(&addr);
|
||||
if (connect(FS_sd, (struct sockaddr *)&addr, sizeof(addr)) >= 0)
|
||||
if (connect(FS_sd, (struct sockaddr *)&addr, AFS_SOCKADDR_LEN(&addr)) >= 0)
|
||||
return 1;
|
||||
if (!f) {
|
||||
FSYNC_clientFinis();
|
||||
@ -367,7 +378,7 @@ FSYNC_sync()
|
||||
|
||||
for (numTries = 0; numTries < MAX_BIND_TRIES; numTries++) {
|
||||
if ((code =
|
||||
bind(AcceptSd, (struct sockaddr *)&addr, sizeof(addr))) == 0)
|
||||
bind(AcceptSd, (struct sockaddr *)&addr, AFS_SOCKADDR_LEN(&addr))) == 0)
|
||||
break;
|
||||
#ifdef USE_UNIX_SOCKETS
|
||||
code = errno;
|
||||
|
Loading…
x
Reference in New Issue
Block a user