net: Rename create_remote_socket() connect_local_socket().
authorAndre Noll <maan@systemlinux.org>
Mon, 23 Aug 2010 13:14:48 +0000 (15:14 +0200)
committerAndre Noll <maan@systemlinux.org>
Mon, 23 Aug 2010 13:14:48 +0000 (15:14 +0200)
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.

afs.c
audioc.c
net.c
net.h

diff --git a/afs.c b/afs.c
index 2b748f255fb0f494bfac0eb786e756b7d9509123..97c3d5694a8dd83fd24c753495bf1411011ae7b9 100644 (file)
--- 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;
index f91f41ffc99e004ff8468000f6579ee045265ff8..b17be3dd1d0a97a175feeff2e3b8f971ad3f725f 100644 (file)
--- 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 be637ec7a5e24e7d1856ed21370139d7a05c5a2c..32f3ffe943d33d7ffca4f002e2d2c1c4a52841da 100644 (file)
--- 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 9da63ba1e14da61511719fc938230ef80b90d42a..75389aecda5d7a5101771f526d74887f34177513 100644 (file)
--- 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*);