]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 't/t0004_fix'
authorAndre Noll <maan@systemlinux.org>
Sun, 18 Mar 2012 20:02:33 +0000 (21:02 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 18 Mar 2012 20:04:58 +0000 (21:04 +0100)
This topic has been cooking for some weeks now and was tested
successfully on all supported operating systems.

NEWS
audioc.c
configure.ac
string.c
web/manual.m4

diff --git a/NEWS b/NEWS
index e5ae590e22605236ada049eb5d758eb293ba901e..5b87555053f907b1226fb1f2867f0d9076206ae9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,9 @@
        - The obscure error messages on mmap() failures have been
          replaced by meaningful messages. This affects mainly
          para_afh.
+       - para_audioc: Cleanups and memory leak fixes.
+       - Test 0004-server no longer fails if para_server is not
+         being built.
 
 -------------------------------------
 0.4.9 (2011-12-06) "hybrid causality"
index 84c2a39472f6fcf58f7c6fecf62e752d35d1a098..d3e092e29301f71e02948259483623e56967966f 100644 (file)
--- a/audioc.c
+++ b/audioc.c
@@ -253,16 +253,15 @@ __noreturn static void print_completions(void)
 
 static char *configfile_exists(void)
 {
-       static char *config_file;
+       char *config_file;
        struct stat statbuf;
+       char *home = para_homedir();
 
-       if (!config_file) {
-               char *home = para_homedir();
-               config_file = make_message("%s/.paraslash/audioc.conf", home);
-               free(home);
-       }
+       config_file = make_message("%s/.paraslash/audioc.conf", home);
+       free(home);
        if (!stat(config_file, &statbuf))
                return config_file;
+       free(config_file);
        return NULL;
 }
 
@@ -272,10 +271,11 @@ static char *configfile_exists(void)
  * \param argc Usual argument count.
  * \param argv Usual argument vector.
  *
- * It creates a temporary local socket in order to communicate with para_audiod.
- * Authentication consists in sending a ucred buffer that contains the user id.
+ * It connects to the "well-known" local socket to communicate with
+ * para_audiod. Authentication is performed by sending a ucred buffer
+ * containing the user id to the local socket.
  *
- * Any output received through the local socket is sent to stdout.
+ * Any data received from the socket is written to stdout.
  *
  * \return EXIT_SUCCESS or EXIT_FAILURE.
  *
@@ -284,7 +284,7 @@ static char *configfile_exists(void)
 int main(int argc, char *argv[])
 {
        int ret = -E_AUDIOC_SYNTAX, fd;
-       char *cf, *buf = NULL, *args;
+       char *cf, *buf = NULL, *args = NULL;
        size_t bufsize;
 
        if (audioc_cmdline_parser(argc, argv, &conf))
@@ -298,7 +298,9 @@ int main(int argc, char *argv[])
                        .check_required = 0,
                        .check_ambiguity = 0
                };
-               if (audioc_cmdline_parser_config_file(cf, &conf, &params)) {
+               ret = audioc_cmdline_parser_config_file(cf, &conf, &params);
+               free(cf);
+               if (ret) {
                        fprintf(stderr, "parse error in config file\n");
                        exit(EXIT_FAILURE);
                }
@@ -342,6 +344,8 @@ int main(int argc, char *argv[])
                ret = write_all(STDOUT_FILENO, buf, n);
        } while (ret >= 0);
 out:
+       free(buf);
+       free(args);
        if (ret < 0)
                PARA_ERROR_LOG("%s\n", para_strerror(-ret));
        return ret < 0? EXIT_FAILURE : EXIT_SUCCESS;
index ac6d53bbbad4d47c5bdffd8b88a06011211eaf9b..224c7be072045d0573f2bbbe269e0a624f4b7c9e 100644 (file)
@@ -758,7 +758,7 @@ if test -n "$with_flac_libs"; then
        LDFLAGS="$LDFLAGS $flac_libs"
 fi
 AC_CHECK_HEADER(FLAC/stream_decoder.h, [], have_flac=no)
-AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], have_flac=no)
+AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_init_file], [], have_flac=no, -logg -lm)
 if test "$have_flac" = "yes"; then
        AC_DEFINE(HAVE_FLAC, 1, define to 1 if you want to build the flacdec filter)
        all_errlist_objs="$all_errlist_objs flacdec_filter flac_afh"
index a1f2a43c65756dc6ce066a5b6707c91b94f4c7d4..aa3bcbddabe425cc823e3ad5e567f707f70dbccb 100644 (file)
--- a/string.c
+++ b/string.c
@@ -128,7 +128,8 @@ __must_check __malloc char *para_strdup(const char *s)
  * function calls exit() if insufficient memory is available, while vasprintf()
  * returns -1 in this case.
  *
- * \return Number of bytes written, not including the terminating '\0'.
+ * \return Number of bytes written, not including the terminating \p NULL
+ * character.
  *
  * \sa printf(3), vsnprintf(3), va_start(3), vasprintf(3), \ref xasprintf().
  */
index e665ea7bf99f183ea0a1479386f580cba7feb113..5a348bb93fc70655889191c134dbb09db619b3e4 100644 (file)
@@ -291,10 +291,20 @@ libmad) is needed for para_server if you only want to stream MP3 or WMA
 files. Also, it's fine to use para_server on a box without sound card.
 
 Next, install the paraslash package on all machines, you'd like this
-software to run on:
+software to run on. If you compile from a released tarball, execute
 
        (./configure && make) > /dev/null
 
+When compiling from git or from snapshots downloaded via gitweb,
+the above command will not work because the configure script is not
+included in the git repository. In this case the following command
+should be used instead:
+
+       ./autogen.sh
+
+This runs autoconf to generate the configure script, then runs it as
+above. Therefore you'll need autoconf for this to work.
+
 There should be no errors but probably some warnings about missing
 packages which usually implies that not all audio formats will be
 supported. If headers or libs are installed at unusual locations you