create_local_socket(): Avoid code duplication.
[paraslash.git] / audiod.c
index 40f02f74907c1b1b60778acb4a742c018fb51014..e8a82b5ed254d447b8edc106e0c6f98d2a64d2f7 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -958,7 +958,7 @@ static int parse_stream_args(void)
 /* does not unlink socket on errors */
 static int audiod_get_socket(void)
 {
-       int ret, fd;
+       int ret;
 
        if (conf.socket_given)
                socket_name = para_strdup(conf.socket_arg);
@@ -975,15 +975,7 @@ static int audiod_get_socket(void)
                S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IWOTH);
        if (ret < 0)
                goto err;
-       fd = ret;
-       if (listen(fd , 5) < 0) {
-               ret = -ERRNO_TO_PARA_ERROR(errno);
-               goto err;
-       }
-       ret = mark_fd_nonblocking(fd);
-       if (ret < 0)
-               goto err;
-       return fd;
+       return ret;
 err:
        PARA_EMERG_LOG("%s\n", para_strerror(-ret));
        exit(EXIT_FAILURE);