Lines Matching refs:sa
329 static int connection_start(Connection *c, struct sockaddr *sa, socklen_t salen) {
333 assert(sa);
336 c->client_fd = socket(sa->sa_family, SOCK_STREAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0);
342 r = connect(c->client_fd, sa, salen);
401 union sockaddr_union sa = {};
407 sa.un.sun_family = AF_UNIX;
408 strncpy(sa.un.sun_path, arg_remote_host, sizeof(sa.un.sun_path)-1);
409 sa.un.sun_path[sizeof(sa.un.sun_path)-1] = 0;
411 salen = offsetof(union sockaddr_union, un.sun_path) + strlen(sa.un.sun_path);
413 return connection_start(c, &sa.sa, salen);
417 sa.un.sun_family = AF_UNIX;
418 sa.un.sun_path[0] = 0;
419 strncpy(sa.un.sun_path+1, arg_remote_host+1, sizeof(sa.un.sun_path)-2);
420 sa.un.sun_path[sizeof(sa.un.sun_path)-1] = 0;
422 salen = offsetof(union sockaddr_union, un.sun_path) + 1 + strlen(sa.un.sun_path + 1);
424 return connection_start(c, &sa.sa, salen);