xc haze
2018-02-26 08:13:49 UTC
Hi:
When I look at XCB communicationïŒ
static int _xcb_open_abstract(char *protocol, const char *file, size_t
filelen)
{
int fd;
struct sockaddr_un addr = {0};
socklen_t namelen;
if (protocol && strcmp("unix",protocol))
return -1;
strcpy(addr.sun_path + 1, file);
addr.sun_family = AF_UNIX;
namelen = offsetof(struct sockaddr_un, sun_path) + 1 + filelen;
ãããããã
ïœ
Why do we add one to addr->sun_path?
When I look at XCB communicationïŒ
static int _xcb_open_abstract(char *protocol, const char *file, size_t
filelen)
{
int fd;
struct sockaddr_un addr = {0};
socklen_t namelen;
if (protocol && strcmp("unix",protocol))
return -1;
strcpy(addr.sun_path + 1, file);
addr.sun_family = AF_UNIX;
namelen = offsetof(struct sockaddr_un, sun_path) + 1 + filelen;
ãããããã
ïœ
Why do we add one to addr->sun_path?