chiark / gitweb /
disobedience/disobedience.c: Stop telling `getopt' to accept `-H' and `-C'.
[disorder] / server / rescan.c
index 792bdf588908fa88d31f59e024a775339b4f4688..b89a0a6350a4aef85997414662195ee1c388f382 100644 (file)
@@ -39,7 +39,7 @@ static const struct option options[] = {
 };
 
 /* display usage message and terminate */
-static void help(void) {
+static void attribute((noreturn)) help(void) {
   xprintf("Usage:\n"
          "  disorder-rescan [OPTIONS] [PATH...]\n"
          "Options:\n"
@@ -75,7 +75,7 @@ static void checkabort(void) {
     exit(0);
   }
   if(signalled) {
-    disorder_info("received signal %d", signalled);
+    disorder_info("received signal %ju", (uintmax_t)signalled);
     trackdb_abort_transaction(global_tid);
     exit(0);
   }
@@ -233,8 +233,11 @@ static int recheck_track_tid(struct recheck_state *cs,
       return 0;
     }
   }
-  /* see if the track has evaporated */
-  if(check(c->module, c->root, path) == 0) {
+  /* see if the track has evaporated or no longer has a player */
+  for(n = 0; (n < config->player.n
+              && fnmatch(config->player.s[n].s[0], t->track, 0) != 0); ++n)
+    ;
+  if(n >= config->player.n || check(c->module, c->root, path) == 0) {
     D(("obsoleting %s", t->track));
     if((err = trackdb_obsolete(t->track, tid)))
       return err;
@@ -399,6 +402,7 @@ int main(int argc, char **argv) {
     openlog(progname, LOG_PID, LOG_DAEMON);
     log_default = &log_syslog;
   }
+  config_per_user = 0;
   if(config_read(0, NULL)) disorder_fatal(0, "cannot read configuration");
   xnice(config->nice_rescan);
   sa.sa_handler = signal_handler;