*(uint32_t *) buf = afs_socket_cookie;
*(int *) (buf + sizeof(afs_socket_cookie)) = query_shmid;
- ret = create_remote_socket(conf.afs_socket_arg);
+ ret = connect_local_socket(conf.afs_socket_arg);
if (ret < 0)
goto out;
fd = ret;
para_strdup("stat");
if (conf.socket_given)
- ret = create_remote_socket(conf.socket_arg);
+ ret = connect_local_socket(conf.socket_arg);
else {
char *hn = para_hostname(), *socket_name = make_message(
"/var/paraslash/audiod_socket.%s", hn);
- ret = create_remote_socket(socket_name);
+ ret = connect_local_socket(socket_name);
free(hn);
free(socket_name);
}
if (ret < 0) {
- PARA_EMERG_LOG("failed to create remote socket\n");
+ PARA_EMERG_LOG("failed to connect to local socket\n");
goto out;
}
fd = ret;
* This function creates a local socket for sequenced, reliable, two-way,
* connection-based byte streams.
*
- * \return The file descriptor, on success, negative on errors.
+ * \return The file descriptor of the connected socket on success, negative on
+ * errors.
*
* \sa create_local_socket(), unix(7), connect(2).
*/
-int create_remote_socket(const char *name)
+int connect_local_socket(const char *name)
{
struct sockaddr_un unix_addr;
int fd, ret;
+ PARA_INFO_LOG("connecting to %s\n", name);
ret = init_unix_addr(&unix_addr, name);
if (ret < 0)
return ret;
int para_accept(int fd, fd_set *rfds, void *addr, socklen_t size, int *new_fd);
int create_local_socket(const char *name, struct sockaddr_un *unix_addr,
mode_t mode);
-int create_remote_socket(const char *name);
+int connect_local_socket(const char *name);
int recv_cred_buffer(int, char *, size_t);
ssize_t send_cred_buffer(int, char*);