From: Andre Noll Date: Sun, 26 Mar 2017 16:04:52 +0000 (+0200) Subject: Merge branch 'refs/heads/t/doc-improvements' X-Git-Url: http://git.tuebingen.mpg.de/?p=adu.git;a=commitdiff_plain;h=2e24b91148dda8ea52b308a4b5e0ef08c0f11267;hp=5fa12abdb75ead7fa6995d38047e10a579df250e Merge branch 'refs/heads/t/doc-improvements' 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. --- diff --git a/Makefile b/Makefile index b5cfebd..8e4d653 100644 --- a/Makefile +++ b/Makefile @@ -72,7 +72,7 @@ adu.1: adu adu.1.inc man2html $< | sed -e 's|^
$$|

|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 37a0867..fe0caa5 100644 --- 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. diff --git a/create.c b/create.c index af5694c..a3373db 100644 --- 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 902e8f1..39e9837 100644 --- 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);