[Pkg-gnupg-commit] [gnupg2] 69/118: agent: Small improvement of the server's local state.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Thu Sep 15 18:25:10 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch encoding-and-speling
in repository gnupg2.

commit 2eeb5551c37659fdd59e8537fc77a9e7fb6a9204
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Sep 5 14:43:42 2016 +0200

    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 at gnupg.org>
---
 agent/command.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/agent/command.c b/agent/command.c
index 9522f89..e66f1ed 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"))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list