]> git.tuebingen.mpg.de Git - adu.git/commitdiff
Merge branch 'refs/heads/t/doc-improvements'
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 26 Mar 2017 16:04:52 +0000 (18:04 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 26 Mar 2017 16:04:52 +0000 (18:04 +0200)
Another topic branch that was cooking for far too long.

* refs/heads/t/doc-improvements:
  Switch from grutatxt to markdown.
  INSTALL: Link to the gengetopt web page.
  manual: Fix a whitespace issue.
  manual: Add example for interactive mode.
  manual: Add two more examples.
  manual: Add example query for omitting a directory.
  manual: Add short option example.
  manual: Remove pointless "time" prefix.
  manual: Improve documentation of --output.

Makefile
adu.c
create.c
fd.c

index b5cfebd74b0b4c5c073be2635cc8f1b2d8681536..8e4d65388c3576aaf64a729cd6e710b2c9724156 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -72,7 +72,7 @@ adu.1: adu adu.1.inc
        man2html $< | sed -e 's|^<DT><DD>$$|<DT><DD><br>|g' > $@
 
 clean:
-       rm -f *.o adu *cmdline.c *cmdline.h adu.1 adu.1.html adu.png index.html adu.sk~
+       rm -f *.o adu *cmdline.c *cmdline.h adu.1 adu.1.html index.html
 
 index.html: adu.1.html index.html.in INSTALL README
        sed -e '/@README@/,$$d' index.html.in > $@
diff --git a/adu.c b/adu.c
index 37a086772fec78a8c099bbfb655e2cb5a734e0b2..fe0caa501a2ce35e5f83273af8dace42f420bde4 100644 (file)
--- a/adu.c
+++ b/adu.c
@@ -296,9 +296,15 @@ static void get_database_dir_or_die(void)
 
        if (conf.database_dir_given)
                tmp = adu_strdup(conf.database_dir_arg);
-       else
+       else {
+               if (!conf.base_dir_arg) {
+                       EMERG_LOG("fatal: neither database dir "
+                               "nor base dir given\n");
+                       exit(EXIT_FAILURE);
+               }
                tmp = make_message("%s%s",
                        conf.database_root_arg, conf.base_dir_arg);
+       }
        /*
         * As we change the cwd during database creation, database_dir
         * must be an absolute path.
index af5694c4cba8b4148d1b083b5307fb2240335a29..a3373db4ff5d975eb46161512ad8654518abe717 100644 (file)
--- a/create.c
+++ b/create.c
@@ -140,10 +140,9 @@ static int scan_dir(char *dirname, uint64_t *parent_dir_num)
        check_signals();
        DEBUG_LOG("----------------- %llu: %s\n", (long long unsigned)current_dir_num, dirname);
        ret = adu_opendir(dirname, &dir, &cwd_fd);
-       if (ret < 0) {
-               if (ret != -ERRNO_TO_ERROR(EACCES))
-                       return ret;
-               WARNING_LOG("permission denied for %s\n", dirname);
+       if (ret < 0) { /* Non-fatal, continue with next dir */
+               WARNING_LOG("skipping dir %s: %s\n", dirname,
+                       adu_strerror(-ret));
                return 1;
        }
        while ((entry = readdir(dir))) {
diff --git a/fd.c b/fd.c
index 902e8f1898d29c7ace5a481c4f731ce7134f4433..39e98374b3acb9ccc727426bf0b6b06d047b57e7 100644 (file)
--- a/fd.c
+++ b/fd.c
@@ -176,9 +176,10 @@ int adu_opendir(const char *dirname, DIR **dir, int *cwd)
        if (*dir)
                return 1;
        ret = -ERRNO_TO_ERROR(errno);
-/* Ignore return value of fchdir() and close(). We're busted anyway. */
-       if (cwd)
-               fchdir(*cwd);
+       /* Ignore return value of fchdir() and close(). We're busted anyway. */
+       if (cwd) {
+               int __a_unused ret2 = fchdir(*cwd); /* STFU, gcc */
+       }
 close_cwd:
        if (cwd)
                close(*cwd);