version 1.138, 2015/09/13 11:12:09 |
version 1.139, 2015/10/11 00:26:23 |
|
|
#include <tls.h> |
#include <tls.h> |
#include "atomicio.h" |
#include "atomicio.h" |
|
|
#ifndef SUN_LEN |
|
#define SUN_LEN(su) \ |
|
(sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) |
|
#endif |
|
|
|
#define PORT_MAX 65535 |
#define PORT_MAX 65535 |
#define PORT_MAX_LEN 6 |
#define PORT_MAX_LEN 6 |
#define UNIX_DG_TMP_SOCKET_SIZE 19 |
#define UNIX_DG_TMP_SOCKET_SIZE 19 |
|
|
return (-1); |
return (-1); |
} |
} |
|
|
if (bind(s, (struct sockaddr *)&sun, SUN_LEN(&sun)) < 0) { |
if (bind(s, (struct sockaddr *)&sun, sizeof(sun)) < 0) { |
close(s); |
close(s); |
return (-1); |
return (-1); |
} |
} |
|
|
errno = ENAMETOOLONG; |
errno = ENAMETOOLONG; |
return (-1); |
return (-1); |
} |
} |
if (connect(s, (struct sockaddr *)&sun, SUN_LEN(&sun)) < 0) { |
if (connect(s, (struct sockaddr *)&sun, sizeof(sun)) < 0) { |
close(s); |
close(s); |
return (-1); |
return (-1); |
} |
} |