]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - afs.c
Fix signedness issues in format strings.
[paraslash.git] / afs.c
diff --git a/afs.c b/afs.c
index cc3fc020370821ff028a2543c354dab4acc08039..5f933c5b31e440438acce2e9179121db66c0600e 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -607,14 +607,17 @@ static int com_select_callback(struct afs_callback_arg *aca)
        if (ret >= 0)
                goto out;
        /* ignore subsequent errors (but log them) */
-       para_printf(&aca->pbout, "could not activate %s: %s\n"
-               "switching back to %s\n",
-               arg, para_strerror(-ret), current_mop? current_mop : "dummy");
-       ret = activate_mood_or_playlist(current_mop, &num_admissible);
-       if (ret >= 0)
-               goto out;
-       para_printf(&aca->pbout, "could not activate %s: %s\nswitching to dummy\n",
-               current_mop, para_strerror(-ret));
+       para_printf(&aca->pbout, "could not activate %s\n", arg);
+       if (current_mop) {
+               int ret2;
+               para_printf(&aca->pbout, "switching back to %s\n", current_mop);
+               ret2 = activate_mood_or_playlist(current_mop, &num_admissible);
+               if (ret2 >= 0)
+                       goto out;
+               para_printf(&aca->pbout, "could not reactivate %s: %s\n",
+                       current_mop, para_strerror(-ret2));
+       }
+       para_printf(&aca->pbout, "activating dummy mood\n");
        activate_mood_or_playlist(NULL, &num_admissible);
 out:
        para_printf(&aca->pbout, "activated %s (%d admissible files)\n",
@@ -649,7 +652,7 @@ static int setup_command_socket_or_die(void)
        ret = create_local_socket(socket_name, 0);
        if (ret < 0) {
                ret = create_local_socket(socket_name,
-                       S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IWOTH);
+                       S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IROTH);
                if (ret < 0) {
                        PARA_EMERG_LOG("%s: %s\n", para_strerror(-ret),
                                socket_name);
@@ -703,7 +706,7 @@ static int open_afs_tables(void)
        int i, ret;
 
        get_database_dir();
-       PARA_NOTICE_LOG("opening %u osl tables in %s\n", NUM_AFS_TABLES,
+       PARA_NOTICE_LOG("opening %d osl tables in %s\n", NUM_AFS_TABLES,
                database_dir);
        for (i = 0; i < NUM_AFS_TABLES; i++) {
                ret = afs_tables[i].open(database_dir);
@@ -1192,7 +1195,7 @@ __must_check int afs_event(enum afs_events event, struct para_buffer *pb,
                        continue;
                ret = t->event_handler(event, pb, data);
                if (ret < 0) {
-                       PARA_CRIT_LOG("table %s, event %d: %s\n", t->name,
+                       PARA_CRIT_LOG("table %s, event %u: %s\n", t->name,
                                event, para_strerror(-ret));
                        return ret;
                }