diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-10-12 13:04:47 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-10-12 13:04:47 +0300 |
commit | 3ae0c04b911637f8145b35959c6a9298e2cff5f6 (patch) | |
tree | b05fe7c8c3255bb403131cc24c25531a79088795 /src/config.c | |
parent | 62e0c7e08e66ffcdfcfb33dd218e2f59e997f674 (diff) | |
download | wydawca-3ae0c04b911637f8145b35959c6a9298e2cff5f6.tar.gz wydawca-3ae0c04b911637f8145b35959c6a9298e2cff5f6.tar.bz2 |
Bugfixes
* src/config.c (cb_spool): Don't open source_dir, as it may not exist
yet.
(create_spool_dirs): Open source_dir here.
* src/wydawca.c (main): Initialize grecs_print_diag_fun.
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/config.c b/src/config.c index 79201d1..d18097a 100644 --- a/src/config.c +++ b/src/config.c @@ -1198,19 +1198,13 @@ cb_spool(enum grecs_callback_command cmd, grecs_node_t *node, rc = 1; } - spool->source_fd = open(spool->source_dir, O_SEARCH); - if (spool->source_fd == -1) { - grecs_error(locus, errno, - _("Cannot open spool source directory %s"), - spool->source_dir); - return 1; - } - if (rc) { //FIXME: free spool */ return rc; } + spool->source_fd = -1; + //FIXME if (NOTIFYQ_EMPTY(&spool->notification_queue)) spool->notification_queue = default_notification; @@ -1607,7 +1601,7 @@ create_spool_dir(struct spool *spool, char const *dir, spool->tag, descr, dir); grecs_error(NULL, 0, "%s", - _("use \"create-directories yes\" t create it")); + _("use \"create-directories yes\" to create it")); return 1; } else { wy_debug(1, (_("%s: creating %s"), spool->tag, descr)); @@ -1696,6 +1690,16 @@ create_spool_dirs(struct spool *spool, void *data) effective_metadata(&dm, &spool->source_metadata), _("source directory"))) *(int *) data = 1; + else { + spool->source_fd = open(spool->source_dir, O_SEARCH); + if (spool->source_fd == -1) { + grecs_error(NULL, errno, + _("Cannot open spool source directory %s"), + spool->source_dir); + *(int *) data = 1; + } + } + if (wy_url_is_local(spool->dest_url) && create_spool_dir(spool, spool->dest_dir, effective_metadata(&dm, &spool->dest_metadata), |