]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
rmblob: Generate proper BLOB_REMOVE_EVENT.
authorAndre Noll <maan@tuebingen.mpg.de>
Fri, 4 Sep 2015 07:24:12 +0000 (09:24 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 4 Sep 2015 07:24:12 +0000 (09:24 +0200)
com_rmblob_callback() of blob.c is responsible for removing blobs from
any of the four blob tables (images, lyrics, moods, playlists). After
a blob has been removed, the function generates an AFS event to tell
the other tables about the removal.

However, the call to afs_event() passes the event identifier
BLOB_RENAME rather than BLOB_REMOVE to the event handlers, which is
clearly incorrect. Fortunately, this does not matter because the only
event handler which cares about blob events is the one in mood.c,
and this handler treats the two events identically. Nevertheless,
it's is a bug that should be fixed.

This bug was introduced eight years ago when event handling was
introduced: commit 02d818d9 (Complete afs event handling).

blob.c

diff --git a/blob.c b/blob.c
index 2f17502143521db2b5178ea457e3149abb60a82f..44e58a1062a3ce4bf27cb0f620cefb4fdca5b329 100644 (file)
--- a/blob.c
+++ b/blob.c
@@ -295,7 +295,7 @@ static void com_rmblob_callback(struct osl_table *table, int fd,
                ret2 = para_printf(&rmbd.pb, "no matches, nothing removed\n");
        else {
                ret2 = para_printf(&rmbd.pb, "removed %d blobs\n", pmd.num_matches);
-               afs_event(BLOB_RENAME, NULL, table);
+               afs_event(BLOB_REMOVE, NULL, table);
        }
 out:
        if (ret2 >= 0 && rmbd.pb.offset)