From: Andre Noll Date: Mon, 23 Aug 2010 13:14:48 +0000 (+0200) Subject: net: Rename create_remote_socket() connect_local_socket(). X-Git-Tag: v0.4.5~36 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=8c488022fea5ba573534585cb7b123836144c6c2;hp=d544360d5aef3afc27174777a6616f0393bba693 net: Rename create_remote_socket() connect_local_socket(). It's all about local unix domain sockets, so avoid the word "remote". Also, this function does not create the socket special in /var/paraslash. --- diff --git a/afs.c b/afs.c index 2b748f25..97c3d569 100644 --- a/afs.c +++ b/afs.c @@ -233,7 +233,7 @@ int send_callback_request(callback_function *f, struct osl_object *query, *(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; diff --git a/audioc.c b/audioc.c index f91f41ff..b17be3dd 100644 --- a/audioc.c +++ b/audioc.c @@ -95,16 +95,16 @@ int main(int argc, char *argv[]) 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; diff --git a/net.c b/net.c index be637ec7..32f3ffe9 100644 --- a/net.c +++ b/net.c @@ -941,15 +941,17 @@ err: * 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; diff --git a/net.h b/net.h index 9da63ba1..75389aec 100644 --- a/net.h +++ b/net.h @@ -151,7 +151,7 @@ int recv_buffer(int fd, char *buf, size_t size); 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*);