diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-08-27 00:15:54 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-08-27 00:15:54 +0200 |
commit | 4521504d17fd2e37c9159b98aba131bd4b5b693f (patch) | |
tree | 684b83f534a646670ca9716938352e7f40b99901 /src/util/taler-exchange-secmod-rsa.c | |
parent | 0b25fe9e91304f9b0be6acebba243481615b7907 (diff) |
-style fixes
Diffstat (limited to 'src/util/taler-exchange-secmod-rsa.c')
-rw-r--r-- | src/util/taler-exchange-secmod-rsa.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/src/util/taler-exchange-secmod-rsa.c b/src/util/taler-exchange-secmod-rsa.c index c80e2e3c4..6be78b20e 100644 --- a/src/util/taler-exchange-secmod-rsa.c +++ b/src/util/taler-exchange-secmod-rsa.c @@ -294,13 +294,13 @@ static int global_ret; * Time when the key update is executed. * Either the actual current time, or a pretended time. */ -static struct GNUNET_TIME_Timestamp now; +static struct GNUNET_TIME_Timestamp global_now; /** * The time for the key update, as passed by the user * on the command line. */ -static struct GNUNET_TIME_Timestamp now_tmp; +static struct GNUNET_TIME_Timestamp global_now_tmp; /** * Where do we store the keys? @@ -893,7 +893,8 @@ setup_key (struct DenominationKey *dk, keydir, denom->section, (unsigned long long) (dk->anchor.abs_time.abs_value_us - / GNUNET_TIME_UNIT_SECONDS.rel_value_us)); + / GNUNET_TIME_UNIT_SECONDS.rel_value_us + )); if (GNUNET_OK != GNUNET_DISK_fn_write (dk->filename, buf, @@ -1973,15 +1974,17 @@ run (void *cls, (void) cls; (void) args; (void) cfgfile; - if (GNUNET_TIME_timestamp_cmp (now, !=, now_tmp)) + if (GNUNET_TIME_timestamp_cmp (global_now, + !=, + global_now_tmp)) { /* The user gave "--now", use it! */ - now = now_tmp; + global_now = global_now_tmp; } else { /* get current time again, we may be timetraveling! */ - now = GNUNET_TIME_timestamp_get (); + global_now = GNUNET_TIME_timestamp_get (); } GNUNET_asprintf (&secname, "%s-secmod-rsa", @@ -1999,24 +2002,20 @@ run (void *cls, global_ret = EXIT_NOTCONFIGURED; return; } - GNUNET_free (secname); if (GNUNET_OK != load_durations (cfg)) { global_ret = EXIT_NOTCONFIGURED; - return; - } - { - char *secname; - - GNUNET_asprintf (&secname, - "%s-secmod-rsa", - section); - global_ret = TES_listen_start (cfg, - secname, - &cb); GNUNET_free (secname); + return; } + GNUNET_asprintf (&secname, + "%s-secmod-rsa", + section); + global_ret = TES_listen_start (cfg, + secname, + &cb); + GNUNET_free (secname); if (0 != global_ret) return; sem_init (&worker_sem, @@ -2047,7 +2046,7 @@ run (void *cls, struct LoadContext lc = { .cfg = cfg, .ret = GNUNET_OK, - .t = now + .t = global_now }; GNUNET_assert (0 == pthread_mutex_lock (&keys_lock)); @@ -2101,7 +2100,7 @@ main (int argc, "time", "TIMESTAMP", "pretend it is a different time for the update", - &now_tmp), + &global_now_tmp), GNUNET_GETOPT_option_uint ('w', "workers", "COUNT", @@ -2118,7 +2117,9 @@ main (int argc, not do this, the linker may "optimize" libtalerutil away and skip #TALER_OS_init(), which we do need */ TALER_OS_init (); - now_tmp = now = GNUNET_TIME_timestamp_get (); + global_now_tmp + = global_now + = GNUNET_TIME_timestamp_get (); ret = GNUNET_PROGRAM_run (argc, argv, "taler-exchange-secmod-rsa", "Handle private RSA key operations for a Taler exchange", |