summaryrefslogtreecommitdiffstats
path: root/agent/command.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2016-09-05 14:43:42 +0200
committerWerner Koch <wk@gnupg.org>2016-09-05 16:24:14 +0200
commit2eeb5551c37659fdd59e8537fc77a9e7fb6a9204 (patch)
tree7cf053d3a76bdbaadb134bcff28b00d7d8126c3b /agent/command.c
parentg10: Refactor cross sig check code. (diff)
downloadgnupg2-2eeb5551c37659fdd59e8537fc77a9e7fb6a9204.tar.xz
gnupg2-2eeb5551c37659fdd59e8537fc77a9e7fb6a9204.zip
agent: Small improvement of the server's local state.
* agent/command.c (sserver_local_s): Change flags to use only one bit. (option_handler): Make an atoi return 1 or 0. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'agent/command.c')
-rw-r--r--agent/command.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/agent/command.c b/agent/command.c
index 9522f8989..e66f1ed35 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -74,21 +74,21 @@ struct server_local_s
operations. It defaults to true but may be set on a per
connection base. The global option opt.ignore_cache_for_signing
takes precedence over this flag. */
- int use_cache_for_signing;
-
- /* An allocated description for the next key operation. This is
- used if a pinnetry needs to be popped up. */
- char *keydesc;
+ unsigned int use_cache_for_signing : 1;
/* Flags to suppress I/O logging during a command. */
- int pause_io_logging;
+ unsigned int pause_io_logging : 1;
- /* If this flags is set to true the agent will be terminated after
+ /* If this flag is set to true the agent will be terminated after
the end of the current session. */
- int stopme;
+ unsigned int stopme : 1;
/* Flag indicating whether pinentry notifications shall be done. */
- int allow_pinentry_notify;
+ unsigned int allow_pinentry_notify : 1;
+
+ /* An allocated description for the next key operation. This is
+ used if a pinnetry needs to be popped up. */
+ char *keydesc;
/* Malloced KEK (Key-Encryption-Key) for the import_key command. */
void *import_key;
@@ -2992,7 +2992,7 @@ option_handler (assuan_context_t ctx, const char *key, const char *value)
err = session_env_setenv (ctrl->session_env, "PINENTRY_USER_DATA", value);
}
else if (!strcmp (key, "use-cache-for-signing"))
- ctrl->server_local->use_cache_for_signing = *value? atoi (value) : 0;
+ ctrl->server_local->use_cache_for_signing = *value? !!atoi (value) : 0;
else if (!strcmp (key, "allow-pinentry-notify"))
ctrl->server_local->allow_pinentry_notify = 1;
else if (!strcmp (key, "pinentry-mode"))