]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 't/audiod_cleanups'
authorAndre Noll <maan@systemlinux.org>
Sun, 6 Oct 2013 16:05:27 +0000 (18:05 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 6 Oct 2013 16:09:26 +0000 (18:09 +0200)
Was cooking for ~2 weeks

1ff4b2 audiod: Don't compute stat info unnecessarily.
d80f5d audiod: Force status dump every 5 seconds.
e34e5f audiod: Improve status timeout handling.
fe7442 audiod: Reorder exit log messages a bit.
32a078 audiod: Fix memory leak on exit: stat client.
706778 audiod: Fix memory leak on exit: gengetopt.
eec23a audiod: Fix memory leak on exit: close slots.
cd5f0a audiod: Unify startup messages of receivers, filters and writers.
597966 audiod: Print a warning if filters are ignored.
a94e8e audiod: Remove pointless continue statement in com_stat().
f45bc6 audiod: Make command array static.
c96792 audiod: Fix error message on status errors.

14 files changed:
GIT-VERSION-GEN
NEWS
acl.c
buffer_tree.c
command.c
crypt.c
fade.c
fd.c
gui.c
ipc.c
net.c
net.h
para.h
score.c

index 32802232244a6a79258f2640e7e0f7e3ddd950a2..df7ed327cb3f9b8f93ec596e629da4c08346e69a 100755 (executable)
@@ -16,7 +16,7 @@ elif [[ -d .git || -f .git ]] &&
        case "$VN" in
        *$LF*) (exit 1) ;;
        v[0-9]*)
-               git update-index -q --refresh
+               git update-index -q --refresh &>/dev/null
                test -z "$(git diff-index --name-only HEAD --)" ||
                VN="$VN-dirty" ;;
        esac
diff --git a/NEWS b/NEWS
index 7cd6838e008319f07a83e58aab3aa3ed98090b94..d1155022a36e1c1ccf623c5eea59fd514463ed2f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,12 @@
 NEWS
 ====
 
+----------------------------------------------
+0.5.1 (to be announced) "temporary implication"
+----------------------------------------------
+
+       - audiod improvements and fixes.
+
 ----------------------------------------
 0.5.0 (2013-08-23) "invertible validity"
 ----------------------------------------
diff --git a/acl.c b/acl.c
index 60f835aefc0e2c777dae34e1a0b80fb371e0268e..e70ab9b350c4bded0395f9676bf3fe7fceef6026 100644 (file)
--- a/acl.c
+++ b/acl.c
@@ -57,7 +57,7 @@ static int acl_lookup(int fd, struct list_head *acl)
                PARA_ERROR_LOG("Can not determine peer address: %s\n", strerror(errno));
                goto no_match;
        }
-       v4_addr = extract_v4_addr(&ss);
+       extract_v4_addr(&ss, &v4_addr);
        if (!v4_addr.s_addr)
                goto no_match;
 
index aa9f1cdb0c95b77635981cea0e6bb1588bbcdc03..b1eeb0363e3741d288656e8c5cea5aa9d186c0ab 100644 (file)
@@ -544,14 +544,16 @@ static bool btr_no_children(struct btr_node *btrn)
 }
 
 /**
- * Find out whether a node is an orphan node.
+ * Find out whether a node is an orphan.
  *
  * \param btrn The buffer tree node.
  *
  * \return True if \a btrn has no parent.
  *
- * This function will always return true for the root node.  However in case
- * nodes have been removed from the tree, other nodes may become orphans too.
+ * This function returns true for the root node and false for any other node.
+ *
+ * After a (non-leaf) node was removed removed from the tree, the function
+ * returns true for all child nodes.
  */
 bool btr_no_parent(struct btr_node *btrn)
 {
index 9f349ee5353c6df5736db1cd2d9c2e115c933248..3d40023f119efc91f446011ae89381790567547f 100644 (file)
--- a/command.c
+++ b/command.c
@@ -220,8 +220,8 @@ int send_sb(struct stream_cipher_context *scc, void *buf, size_t numbytes,
        int ret;
        struct sb_context *sbc;
        struct iovec iov[2];
-       struct sb_buffer sbb = SBB_INIT(band, buf, numbytes);
        sb_transformation trafo = band < SBD_PROCEED? NULL : sc_trafo;
+       struct sb_buffer sbb = SBB_INIT(band, buf, numbytes);
 
        sbc = sb_new_send(&sbb, dont_free, trafo, scc->send);
        do {
@@ -842,7 +842,7 @@ static int parse_sb_command(struct command_context *cc, struct iovec *iov)
        if (ret < 0)
                goto out;
        end = iov->iov_base + iov->iov_len;
-       for (i = 0, p = iov->iov_base; p < end; i++)
+       for (i = 0; p < end; i++)
                p += strlen(p) + 1;
        cc->argc = i;
        cc->argv = para_malloc((cc->argc + 1) * sizeof(char *));
diff --git a/crypt.c b/crypt.c
index b8577dfc5ab164a5f0b382273aab1c8083a05ef1..5445138d53f6589ebce6645b027531f02b74c860 100644 (file)
--- a/crypt.c
+++ b/crypt.c
@@ -147,8 +147,7 @@ static int read_rsa_bignums(const unsigned char *blob, int blen, RSA **result)
        *result = rsa;
        return 1;
 fail:
-       if (rsa)
-               RSA_free(rsa);
+       RSA_free(rsa);
        return ret;
 }
 
diff --git a/fade.c b/fade.c
index 878b83a17e26f40da9c33c6035dba345353257d4..a8424d67a5db24ea2967670ee6eb90ccaf284100 100644 (file)
--- a/fade.c
+++ b/fade.c
@@ -27,7 +27,7 @@ static struct mixer supported_mixer[] = {MIXER_ARRAY};
 #define FOR_EACH_MIXER(i) for ((i) = 0; (i) < NUM_SUPPORTED_MIXERS; (i)++)
 
 static int loglevel;
-__printf_2_3 void date_log(int ll, const char *fmt, ...)
+static __printf_2_3 void date_log(int ll, const char *fmt, ...)
 {
        va_list argp;
        time_t t1;
diff --git a/fd.c b/fd.c
index 3ab5cad06d1c2980b758062701b681f7761f4664..4d4a859b08cf0e13dddea8aa724f94099a0518b1 100644 (file)
--- a/fd.c
+++ b/fd.c
@@ -526,6 +526,7 @@ static int para_opendir(const char *dirname, DIR **dir, int *cwd)
 {
        int ret;
 
+       *dir = NULL;
        if (cwd) {
                ret = para_open(".", O_RDONLY, 0);
                if (ret < 0)
diff --git a/gui.c b/gui.c
index baab0bd905e56fee0a7a821e0c536e15b532db5f..54fc9db98bd91ad836eb79288d42927eadcb1fcf 100644 (file)
--- a/gui.c
+++ b/gui.c
@@ -526,7 +526,7 @@ static int add_output_line(char *line, void *data)
 
 static int loglevel;
 
-__printf_2_3 void curses_log(int ll, const char *fmt,...)
+static __printf_2_3 void curses_log(int ll, const char *fmt,...)
 {
        int color;
        char *msg;
diff --git a/ipc.c b/ipc.c
index 1ec53c30204e336a9b75a1992d063910c618e80d..89bbe53564e3c678e97b453e38b7c70be8063314 100644 (file)
--- a/ipc.c
+++ b/ipc.c
@@ -209,6 +209,7 @@ size_t shm_get_shmmax(void)
                                buf[ret] = '\0';
                                shmmax = strtoul(buf, NULL, 10);
                        }
+                       close(fd);
                }
        }
 #elif defined SYSCTL_SHMMAX_VARIABLE
diff --git a/net.c b/net.c
index 2ec3f03e546b3b1f3c038b7eea2e9cf8cf8a3438..4a31f013446877e45c780e7eb24a27a0a1042c3a 100644 (file)
--- a/net.c
+++ b/net.c
@@ -672,19 +672,19 @@ char *remote_name(int sockfd)
 
 /**
  * Extract IPv4 or IPv6-mapped-IPv4 address from sockaddr_storage.
- * \param ss Container of IPv4/6 address
- * \return Extracted IPv4 address (different from 0) or 0 if unsuccessful.
  *
- * \sa RFC 3493
+ * \param ss Container of IPv4/6 address.
+ * \param ia Extracted IPv4 address (different from 0) or 0 if unsuccessful.
+ *
+ * \sa RFC 3493.
  */
-struct in_addr extract_v4_addr(const struct sockaddr_storage *ss)
+void extract_v4_addr(const struct sockaddr_storage *ss, struct in_addr *ia)
 {
-       struct in_addr ia = {.s_addr = 0};
        const struct sockaddr *sa = normalize_ip_address(ss);
 
+       memset(ia, 0, sizeof(*ia));
        if (sa->sa_family == AF_INET)
-               ia = ((struct sockaddr_in *)sa)->sin_addr;
-       return ia;
+               *ia = ((struct sockaddr_in *)sa)->sin_addr;
 }
 
 /**
diff --git a/net.h b/net.h
index ae5e80150cca3b8d9b4aef93fb9dfe8e98592e79..0003fa9d57d22ad4a6ce39f530ec12348008aebb 100644 (file)
--- a/net.h
+++ b/net.h
@@ -114,7 +114,7 @@ static inline int para_connect_simple(unsigned l4type,
        return makesock(l4type, 0, host, port, NULL);
 }
 
-extern struct in_addr extract_v4_addr(const struct sockaddr_storage *ss);
+void extract_v4_addr(const struct sockaddr_storage *ss, struct in_addr *ia);
 
 /**
  * Functions to support listening sockets.
diff --git a/para.h b/para.h
index 6655d35672f410ebff1a5678841e9fee967c7996..29658f476e93ef53bdcb545faf46a63dd7bd8bdd 100644 (file)
--- a/para.h
+++ b/para.h
@@ -62,7 +62,7 @@ extern __printf_2_3 void (*para_log)(int, const char*, ...);
  *
  */
 #define DEFINE_STDERR_LOGGER(funcname, loglevel_barrier) \
-       __printf_2_3 void funcname(int ll, const char* fmt,...) \
+       static __printf_2_3 void funcname(int ll, const char* fmt,...) \
        { \
                va_list argp; \
                if (ll < loglevel_barrier) \
diff --git a/score.c b/score.c
index ca94e8de3d645015b45ae0462938f1e2e4ebe559..37f4c55072d920bcef85ec622f6568c91b0ed11e 100644 (file)
--- a/score.c
+++ b/score.c
@@ -168,13 +168,11 @@ static int get_nth_score(unsigned n, long *score)
  * \param aft_row Determines the audio file to change.
  * \param percent The position to re-insert the audio file.
  *
- * The percent parameter must be between \p 0 and 100 and. A value of zero
- * means to re-insert the audio file into the score table with a score lower
- * than any other admissible file.
+ * The percent parameter must be between 0 and 100. A value of zero means to
+ * re-insert the audio file into the score table with a score lower than any
+ * other admissible file.
  *
- * \return Positive on success, negative on errors. Possible errors: Errors
- * returned by osl_get_row(), get_num_admissible_files(), osl_get_nth_row(),
- * osl_get_object(), osl_update_object().
+ * \return Positive on success, negative on errors.
  */
 int score_update(const struct osl_row *aft_row, long percent)
 {