agent: Clean up error initialize/return.
authorNIIBE Yutaka <gniibe@fsij.org>
Fri, 14 Apr 2017 03:54:06 +0000 (12:54 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Fri, 14 Apr 2017 03:54:06 +0000 (12:54 +0900)
* agent/call-pinentry.c (start_pinentry): Return RC.
* agent/command-ssh.c (ssh_handler_request_identities): Don't set ERR.
* agent/findkey.c (try_unprotect_cb): Return ERR.
(unprotect): Don't set RC.
* agent/gpg-agent.c (handle_connections): Don't set fd.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
agent/call-pinentry.c
agent/command-ssh.c
agent/findkey.c
agent/gpg-agent.c

index a35a3fb..6524cb1 100644 (file)
@@ -654,7 +654,7 @@ start_pinentry (ctrl_t ctrl)
 
   xfree (flavor_version);
 
-  return 0;
+  return rc;
 }
 
 
index eeb1498..5c7cf1f 100644 (file)
@@ -2576,7 +2576,6 @@ ssh_handler_request_identities (ctrl_t ctrl,
 
   key_public = NULL;
   key_counter = 0;
-  err = 0;
 
   key_blobs = es_fopenmem (0, "r+b");
   if (! key_blobs)
index 0b2ddf1..f3c8ca9 100644 (file)
@@ -328,7 +328,7 @@ try_unprotect_cb (struct pin_entry_info_s *pi)
       xfree (desc);
     }
 
-  return 0;
+  return err;
 }
 
 
@@ -552,7 +552,6 @@ unprotect (ctrl_t ctrl, const char *cache_nonce, const char *desc_text,
               return 0;
             }
           xfree (pw);
-          rc  = 0;
         }
       else if (cache_mode == CACHE_MODE_NORMAL)
         {
@@ -590,7 +589,6 @@ unprotect (ctrl_t ctrl, const char *cache_nonce, const char *desc_text,
                   return 0;
                 }
               xfree (pw);
-              rc  = 0;
             }
         }
 
index e23f438..c764be8 100644 (file)
@@ -2964,7 +2964,6 @@ handle_connections (gnupg_fd_t listen_fd,
                       xfree (ctrl);
                     }
                 }
-              fd = GNUPG_INVALID_FD;
             }
         }
     }