make get_playlist_data() generic.
[paraslash.git] / audioc.c
index 31b98b5..66ff2a2 100644 (file)
--- a/audioc.c
+++ b/audioc.c
@@ -6,12 +6,15 @@
 
 /** \file audioc.c the client program used to connect to para_audiod */
 
+#include <sys/types.h>
+#include <dirent.h>
+
 #include "audioc.cmdline.h"
 #include "para.h"
+#include "error.h"
 #include "net.h"
 #include "string.h"
 #include "fd.h"
-#include "error.h"
 
 INIT_AUDIOC_ERRLISTS;
 
@@ -103,16 +106,17 @@ int main(int argc, char *argv[])
                tmpsocket_name = make_message("%s/.paraslash/audioc_sock.%s.%s",
                        home, hn, randname);
 
-       ret = create_pf_socket(tmpsocket_name, &unix_addr, S_IRUSR | S_IWUSR);
+       ret = create_local_socket(tmpsocket_name, &unix_addr, S_IRUSR | S_IWUSR);
        unlink(tmpsocket_name);
+       free(tmpsocket_name);
        if (ret < 0)
                goto out;
        fd = ret;
        ret = -E_INIT_SOCK_ADDR;
        if (init_unix_addr(&unix_addr, socket_name) < 0)
                goto out;
-       ret = -E_AUDIOC_CONNECT;
-       if (connect(fd, (struct sockaddr *)&unix_addr, UNIX_PATH_MAX) < 0)
+       ret = PARA_CONNECT(fd, &unix_addr);
+       if (ret < 0)
                goto out;
        ret = send_cred_buffer(fd, args);
        if (ret < 0)