aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-04-23 21:14:49 +0300
committerSergey Poznyakoff <gray@gnu.org>2020-04-23 21:27:47 +0300
commit8234484dba123ad8001657def8fb57133f9610bf (patch)
tree3c648730985b0ec37ed6fa5af7fe35fedaeb3c31 /src
parent80466e8f237077f11134554ab1a68b47f49616e2 (diff)
downloadwydawca-8234484dba123ad8001657def8fb57133f9610bf.tar.gz
wydawca-8234484dba123ad8001657def8fb57133f9610bf.tar.bz2
Rewrite the testsuite.
Use gpg2 to create the keys, and sign files as necessary. * NEWS: Update. * doc/wydawca.texi: Update. * configure.ac: Detect the presence of GPG version 2. * src/cmdline.opt (--single-process): Remove. * src/config.c: Remove the "single-process" statement. * src/triplet.c (triplet_enqueue): Fix eventual NULL dereference. (wy_triplet_wait): Update the WY_STAT_INCOMPLETE_TRIPLETS counter. * src/wydawca.c (single_process_option): Remove global. * src/wydawca.h (single_process): Remove global. * tests/.gitignore: Update. * tests/Makefile.am: Update. * tests/atlocal.in: Rewrite. * tests/chargen.c: New auxiliary tool * tests/dist/file: Remove. * tests/dist/file.directive.asc: Remove. * tests/dist/file.sig: Remove. * tests/dist/file12f.directive.asc: Remove. * tests/dist/file12t.directive.asc: Reemove. * tests/dist/rmsymlink.directive.asc: Remove. * tests/dist/symlink.directive.asc: Remove. * tests/etc/notify.cfin: Rename to tests/etc/notify.cf * tests/etc/Makefile.am: Update. * tests/etc/dbgen.sh: New file. * tests/etc/keygen.sh: New file. * tests/etc/project: New file. * tests/etc/pubring.asc: Remove. * tests/etc/secring.asc: Remove. * tests/etc/wydawca.cfin: Remove. * tests/*.at: Rewrite.
Diffstat (limited to 'src')
-rw-r--r--src/cmdline.opt12
-rw-r--r--src/config.c7
-rw-r--r--src/triplet.c10
-rw-r--r--src/wydawca.c4
-rw-r--r--src/wydawca.h1
5 files changed, 14 insertions, 20 deletions
diff --git a/src/cmdline.opt b/src/cmdline.opt
index fae3cb1..a23335d 100644
--- a/src/cmdline.opt
+++ b/src/cmdline.opt
@@ -96,12 +96,6 @@ BEGIN
foreground_option = 1;
END
-OPTION(single-process,,,
- [<single process mode>])
-BEGIN
- single_process_option = 1;
-END
-
OPTION(config-file,c,FILE,
[<use FILE instead of the default configuration>])
BEGIN
@@ -180,10 +174,10 @@ END
GROUP(Debugging)
-OPTION(debug,d,,
- [<increase debugging level>])
+OPTION(debug,d,[<LEVEL>],
+ [<set debugging level>])
BEGIN
- wy_debug_level++;
+ wy_debug_level = atoi(optarg);
END
OPTION(dump-grammar-trace,,,
diff --git a/src/config.c b/src/config.c
index 9d78ed3..6b99801 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1390,9 +1390,6 @@ static struct grecs_keyword wydawca_kw[] = {
{ "foreground", NULL,
N_("Start in foreground even in daemon mode"),
grecs_type_bool, GRECS_DFLT, &foreground },
- { "single-process", NULL,
- N_("Do not spawn subprocesses"),
- grecs_type_bool, GRECS_DFLT, &single_process },
{ "pidfile", N_("file"),
N_("Set pid file name"),
grecs_type_string, GRECS_CONST, &pidfile},
@@ -1727,7 +1724,7 @@ config_finish(struct grecs_node *tree)
if (file_sweep_time <= 0) {
file_sweep_time = DEFAULT_FILE_SWEEP_TIME;
wy_log(LOG_NOTICE,
- _("file-sweep-time too low; reverting to the default %ds"),
- file_sweep_time);
+ _("file-sweep-time too low; reverting to the default %lus"),
+ (unsigned long)file_sweep_time);
}
}
diff --git a/src/triplet.c b/src/triplet.c
index bde3c14..980c906 100644
--- a/src/triplet.c
+++ b/src/triplet.c
@@ -355,9 +355,10 @@ void
triplet_enqueue(struct wy_triplet *trp)
{
pthread_t tid;
- struct spool *spool = trp->spool;
+ struct spool *spool;
if (!trp)
return;
+ spool = trp->spool;
timer_start(WY_TIMER_SPOOL);
timer_start(spool->timer_id);
if (spool_open_dictionaries(spool) == 0) {
@@ -511,12 +512,19 @@ wy_thr_cleaner(void *ptr)
void
wy_triplet_wait(void)
{
+ size_t n;
+
triplet_list_lock(&triplet_running_list);
while (triplet_running_list.head) {
pthread_cond_wait(&triplet_running_list.cond,
&triplet_running_list.mutex);
}
triplet_list_unlock(&triplet_running_list);
+
+ pthread_mutex_lock(&triplet_table_mutex);
+ n = grecs_symtab_count(triplet_table);
+ pthread_mutex_unlock(&triplet_table_mutex);
+ *wy_get_stat_slot(WY_STAT_INCOMPLETE_TRIPLETS) += n;
}
static pthread_key_t key;
diff --git a/src/wydawca.c b/src/wydawca.c
index 01ef56c..5771feb 100644
--- a/src/wydawca.c
+++ b/src/wydawca.c
@@ -44,10 +44,8 @@ int wy_mode_option = -1;
int preprocess_only = 0;
int foreground_option = -1;
-int single_process_option = -1;
int foreground;
-int single_process;
time_t wakeup_interval;
struct grecs_list *all_spool_aliases;
char *wy_gpg_homedir;
@@ -417,8 +415,6 @@ main(int argc, char **argv)
wy_mode = wy_mode_option;
if (foreground_option >= 0)
foreground = foreground_option;
- if (single_process_option >= 0)
- single_process = single_process_option;
if (wy_log_to_stderr == -1) {
switch (wy_mode) {
diff --git a/src/wydawca.h b/src/wydawca.h
index 90a886e..b3ece49 100644
--- a/src/wydawca.h
+++ b/src/wydawca.h
@@ -330,7 +330,6 @@ enum {
extern int wy_mode;
extern int foreground;
-extern int single_process;
extern struct grecs_sockaddr listen_sockaddr;
extern size_t max_connections;
extern time_t idle_timeout;

Return to:

Send suggestions and report system problems to the System administrator.