]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 'refs/heads/t/tarball-build-fix'
authorAndre Noll <maan@systemlinux.org>
Fri, 23 Jan 2015 12:17:10 +0000 (13:17 +0100)
committerAndre Noll <maan@systemlinux.org>
Fri, 23 Jan 2015 12:17:10 +0000 (13:17 +0100)
Makefile.real
aft.c
blob.c
client_common.c
command.c
fd.c
gui.c
mood.c
score.c
string.c

index 440220ce83e090aba486116320892ce9785af1ad..6c7b38f2a1de7880b09d6bcce5ad65283dea8dff 100644 (file)
@@ -188,7 +188,8 @@ error2.h: $(hostbin_dir)/error2 config.h
 $(object_dir)/%.o: %.c | $(object_dir)
 
 $(object_dir)/opus%.o $(dep_dir)/opus%.d: CPPFLAGS += $(opus_cppflags)
-$(object_dir)/gui%.o $(dep_dir)/gui%.d: CPPFLAGS += $(curses_cppflags)
+$(object_dir)/gui.o $(object_dir)/gui%.o $(dep_dir)/gui%.d \
+: CPPFLAGS += $(curses_cppflags)
 $(object_dir)/spx%.o $(dep_dir)/spx%.d: CPPFLAGS += $(speex_cppflags)
 $(object_dir)/flac%.o $(dep_dir)/flac%.d: CPPFLAGS += $(flac_cppflags)
 
diff --git a/aft.c b/aft.c
index c61d3820083bd0ff9c5fbfbf773f49fc5c04a51a..727292c7001cf5b175eb8ef43b063540fc25d4d7 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -829,8 +829,8 @@ static int print_chunk_table(struct ls_data *d, struct para_buffer *b)
        ret = aft_get_row_of_hash(d->hash, &aft_row);
        if (ret < 0)
                return ret;
-       ret = osl_open_disk_object(audio_file_table, aft_row,
-               AFTCOL_CHUNKS, &chunk_table_obj);
+       ret = osl(osl_open_disk_object(audio_file_table, aft_row,
+               AFTCOL_CHUNKS, &chunk_table_obj));
        if (ret < 0)
                return ret;
        ret = para_printf(b, "%s\n"
@@ -1105,10 +1105,10 @@ int open_and_update_audio_file(struct osl_row *aft_row, long score,
        if (ret < 0)
                return ret;
        afd->afhi.chunk_table = NULL;
-       ret = osl_open_disk_object(audio_file_table, aft_row,
-               AFTCOL_CHUNKS, &chunk_table_obj);
+       ret = osl(osl_open_disk_object(audio_file_table, aft_row,
+               AFTCOL_CHUNKS, &chunk_table_obj));
        if (ret < 0)
-               goto err;
+               return ret;
        ret = mmap_full_file(path, O_RDONLY, &map.data, &map.size, &afd->fd);
        if (ret < 0)
                goto err;
@@ -1716,10 +1716,11 @@ static void com_add_callback(int fd, const struct osl_object *query)
                struct osl_object obj;
                if (pb) { /* hs trumps pb, remove pb */
                        if (flags & ADD_FLAG_VERBOSE) {
-                               ret = para_printf(&msg, "removing path brother\n");
+                               ret = para_printf(&msg, "removing %s\n", path);
                                if (ret < 0)
                                        goto out;
                        }
+                       afs_event(AUDIO_FILE_REMOVE, &msg, pb);
                        ret = osl(osl_del_row(audio_file_table, pb));
                        if (ret < 0)
                                goto out;
diff --git a/blob.c b/blob.c
index 3f7c48daa74251f15b798ec6f0fdefe39496f466..7aedf59bb9d3da7ead694f9c2d85c2d8e52da9d7 100644 (file)
--- a/blob.c
+++ b/blob.c
@@ -645,7 +645,7 @@ static int blob_get_name_and_def_by_row(struct osl_table *table,
        static int table_name ## _create(const char *dir) \
        { \
                table_name ## _table_desc.dir = dir; \
-               return osl_create_table(&table_name ## _table_desc); \
+               return osl(osl_create_table(&table_name ## _table_desc)); \
        }
 
 static int blob_open(struct osl_table **table,
index f615bb7289bd1951057a20743a21045019109a18..b47364c9bd7b91c09d2e0c28fedc69efd3e5c6d0 100644 (file)
@@ -159,7 +159,10 @@ again:
        }
        if (n == 0)
                return 0;
-       if (!sb_received(ct->sbc[0], n, result))
+       ret = sb_received(ct->sbc[0], n, result);
+       if (ret < 0)
+               return ret;
+       if (ret == 0)
                goto again;
        ct->sbc[0] = NULL;
        return 1;
index 43f85ca67a5e7b35c56d430f7da75cfdb64c7f94..2ef9c5a87b54760ed38fc41e4f3b83391a4aa3f5 100644 (file)
--- a/command.c
+++ b/command.c
@@ -419,6 +419,7 @@ static int com_version(struct command_context *cc)
        return send_sb(&cc->scc, msg, len, SBD_OUTPUT, false);
 }
 
+/** These status items are cleared if no audio file is currently open. */
 #define EMPTY_STATUS_ITEMS \
        ITEM(PATH) \
        ITEM(DIRECTORY) \
@@ -445,7 +446,11 @@ static int com_version(struct command_context *cc)
        ITEM(YEAR) \
        ITEM(ALBUM) \
        ITEM(COMMENT) \
-       ITEM(AMPLIFICATION)
+       ITEM(MTIME) \
+       ITEM(FILE_SIZE) \
+       ITEM(CHUNK_TIME) \
+       ITEM(NUM_CHUNKS) \
+       ITEM(AMPLIFICATION) \
 
 /**
  * Write a list of audio-file related status items with empty values.
diff --git a/fd.c b/fd.c
index 456476e59ca3d1757a9828f8dec055cfc34aefd4..ceff71f584545bb6356d38129c436e8d393fe38c 100644 (file)
--- a/fd.c
+++ b/fd.c
@@ -144,6 +144,7 @@ __printf_2_3 int write_va_buffer(int fd, const char *fmt, ...)
 
        va_start(ap, fmt);
        ret = xvasprintf(&msg, fmt, ap);
+       va_end(ap);
        ret = write_all(fd, msg, ret);
        free(msg);
        return ret;
diff --git a/gui.c b/gui.c
index 552b625bb9749b40538bcf229d813125f09bd500..370c731cb916ac00749ad6ccdfbdd8138d2c41cb 100644 (file)
--- a/gui.c
+++ b/gui.c
@@ -659,7 +659,8 @@ static int status_post_select(struct sched *s, void *context)
        ret2 = for_each_stat_item(st->buf, st->loaded, update_item);
        if (ret < 0 || ret2 < 0) {
                st->loaded = 0;
-               PARA_NOTICE_LOG("closing stat pipe: %s\n", para_strerror(-ret));
+               PARA_NOTICE_LOG("closing stat pipe: %s\n",
+                       para_strerror(ret < 0? -ret : -ret2));
                close(st->fd);
                st->fd = -1;
                clear_all_items();
diff --git a/mood.c b/mood.c
index dce72a7b93187bb227be92a00159c3dfd1e29f03..8d171bde93170dd110ffe4d1b480dc313a8c61de 100644 (file)
--- a/mood.c
+++ b/mood.c
@@ -30,7 +30,7 @@ struct afs_statistics {
        int64_t num_played_sum;
        /** Sum of last played times over all admissible files. */
        int64_t last_played_sum;
-       /** Quadratic deviation of num played time. */
+       /** Quadratic deviation of num played count. */
        int64_t num_played_qd;
        /** Quadratic deviation of last played time. */
        int64_t last_played_qd;
diff --git a/score.c b/score.c
index 3c5e04f633542b232c17bcc0de542872f3ecaef3..81b3ded0021f41115dcc78a8f9605d722195c389 100644 (file)
--- a/score.c
+++ b/score.c
@@ -71,7 +71,7 @@ static struct osl_column_description score_cols[] = {
        },
        [SCORECOL_SCORE] = {
                .storage_type = OSL_NO_STORAGE,
-               .storage_flags = OSL_RBTREE | OSL_FIXED_SIZE,
+               .storage_flags = OSL_RBTREE | OSL_FIXED_SIZE | OSL_UNIQUE,
                .name = "score",
                .compare_function = score_compare,
                .data_size = sizeof(long)
index 453a61c16e9b76dec4d5a427df2a3e6fff422e75..f8b64b77c08d0c109c62129bdfeac04b775b3d6b 100644 (file)
--- a/string.c
+++ b/string.c
@@ -31,8 +31,8 @@
  * A wrapper for realloc(3). It calls \p exit(\p EXIT_FAILURE) on errors,
  * i.e. there is no need to check the return value in the caller.
  *
- * \return A pointer to  the newly allocated memory, which is suitably aligned
- * for any kind of variable and may be different from \a p.
+ * \return A pointer to newly allocated memory which is suitably aligned for
+ * any kind of variable and may be different from \a p.
  *
  * \sa realloc(3).
  */
@@ -380,14 +380,13 @@ int for_each_line(unsigned flags, char *buf, size_t size,
                char *next_cr;
 
                next_cr = memchr(start, '\n', buf + size - start);
-               next_null = memchr(start, '\0', buf + size - start);
+               next_null = memchr(start, '\0', next_cr?
+                       next_cr - start : buf + size - start);
                if (!next_cr && !next_null)
                        break;
-               if (next_cr && next_null) {
-                       end = next_cr < next_null? next_cr : next_null;
-               } else if (next_null) {
+               if (next_null)
                        end = next_null;
-               else
+               else
                        end = next_cr;
                num_lines++;
                if (!(flags & FELF_DISCARD_FIRST) || start != buf) {