[svn] GnuPG - r5180 - trunk/tools
svn author marcus
cvs at cvs.gnupg.org
Fri Oct 16 20:29:01 CEST 2009
Author: marcus
Date: 2009-10-16 20:29:01 +0200 (Fri, 16 Oct 2009)
New Revision: 5180
Modified:
trunk/tools/gpg-connect-agent.c
Log:
Somehow this slipped through. Really commit this time.
2009-09-23 Marcus Brinkmann <marcus at g10code.de>
* gpg-connect-agent.c (getinfo_pid_cb, read_and_print_response)
(main): Update to new Assuan API.
Modified: trunk/tools/gpg-connect-agent.c
===================================================================
--- trunk/tools/gpg-connect-agent.c 2009-10-16 13:13:00 UTC (rev 5179)
+++ trunk/tools/gpg-connect-agent.c 2009-10-16 18:29:01 UTC (rev 5180)
@@ -1224,7 +1224,15 @@
no_close[0] = fileno (stderr);
no_close[1] = log_get_fd ();
no_close[2] = -1;
- rc = assuan_pipe_connect_ext (&ctx, *argv, (const char **)argv,
+
+ rc = assuan_new (&ctx);
+ if (rc)
+ {
+ log_error ("assuan_new failed: %s\n", gpg_strerror (rc));
+ exit (1);
+ }
+
+ rc = assuan_pipe_connect_ext (ctx, *argv, argv,
no_close, NULL, NULL,
opt.connect_flags);
if (rc)
@@ -1240,7 +1248,14 @@
}
else if (opt.raw_socket)
{
- rc = assuan_socket_connect_ext (&ctx, opt.raw_socket, 0,
+ rc = assuan_new (&ctx);
+ if (rc)
+ {
+ log_error ("assuan_new failed: %s\n", gpg_strerror (rc));
+ exit (1);
+ }
+
+ rc = assuan_socket_connect_ext (ctx, opt.raw_socket, 0,
opt.connect_flags);
if (rc)
{
@@ -2086,9 +2101,16 @@
{
char *sockname;
+ rc = assuan_new (&ctx);
+ if (rc)
+ {
+ log_error ("assuan_new failed: %s\n", gpg_strerror (rc));
+ exit (1);
+ }
+
/* Check whether we can connect at the standard socket. */
sockname = make_filename (opt.homedir, "S.gpg-agent", NULL);
- rc = assuan_socket_connect (&ctx, sockname, 0);
+ rc = assuan_socket_connect (ctx, sockname, 0);
#ifdef HAVE_W32_SYSTEM
/* If we failed to connect under Windows, we fire up the agent. */
@@ -2115,7 +2137,14 @@
/* Give the agent some time to prepare itself. */
gnupg_sleep (3);
/* Now try again to connect the agent. */
- rc = assuan_socket_connect (&ctx, sockname, 0);
+ rc = assuan_new (&ctx);
+ if (rc)
+ {
+ log_error ("assuan_new failed: %s\n", gpg_strerror (rc));
+ exit (1);
+ }
+
+ rc = assuan_socket_connect (ctx, sockname, 0);
}
if (rc)
rc = save_rc;
@@ -2148,7 +2177,14 @@
exit (1);
}
- rc = assuan_socket_connect (&ctx, infostr, pid);
+ rc = assuan_new (&ctx);
+ if (rc)
+ {
+ log_error ("assuan_new failed: %s\n", gpg_strerror (rc));
+ exit (1);
+ }
+
+ rc = assuan_socket_connect (ctx, infostr, pid);
xfree (infostr);
}
More information about the Gnupg-commits
mailing list