aboutsummaryrefslogtreecommitdiffstats
path: root/assuan/assuan-socket-connect.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2009-03-06 22:29:49 +0000
committerMarcus Brinkmann <[email protected]>2009-03-06 22:29:49 +0000
commit9ace1d56423f849b23fecdb77dd7ad6854975460 (patch)
tree212cfbddf9a9a640d597f2b39c993b166852e811 /assuan/assuan-socket-connect.c
parentChnaged the op-assuan interface. (diff)
downloadgpgme-9ace1d56423f849b23fecdb77dd7ad6854975460.tar.gz
gpgme-9ace1d56423f849b23fecdb77dd7ad6854975460.zip
assuan/
2009-03-06 Marcus Brinkmann <[email protected]> * assuan/: Update to libassuan SVN 2009-03-06. src/ 2009-03-06 Marcus Brinkmann <[email protected]> * version.c (do_subsystem_inits): Do not set assuan log level. * debug.c (debug_init): Likewise.
Diffstat (limited to 'assuan/assuan-socket-connect.c')
-rw-r--r--assuan/assuan-socket-connect.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/assuan/assuan-socket-connect.c b/assuan/assuan-socket-connect.c
index 5953f1c3..8eb6d828 100644
--- a/assuan/assuan-socket-connect.c
+++ b/assuan/assuan-socket-connect.c
@@ -14,9 +14,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- * USA.
+ * License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
@@ -57,12 +55,12 @@
static int
do_finish (assuan_context_t ctx)
{
- if (ctx->inbound.fd != -1)
+ if (ctx->inbound.fd != ASSUAN_INVALID_FD)
{
_assuan_close (ctx->inbound.fd);
}
- ctx->inbound.fd = -1;
- ctx->outbound.fd = -1;
+ ctx->inbound.fd = ASSUAN_INVALID_FD;
+ ctx->outbound.fd = ASSUAN_INVALID_FD;
return 0;
}
@@ -87,18 +85,17 @@ assuan_socket_connect (assuan_context_t *r_ctx,
/* Make a connection to the Unix domain socket NAME and return a new
Assuan context in CTX. SERVER_PID is currently not used but may
become handy in the future. With flags set to 1 sendmsg and
- recvmesg are used. */
+ recvmsg are used. */
assuan_error_t
assuan_socket_connect_ext (assuan_context_t *r_ctx,
const char *name, pid_t server_pid,
unsigned int flags)
{
- static struct assuan_io io = { _assuan_simple_read,
- _assuan_simple_write };
-
+ static struct assuan_io io = { _assuan_simple_read, _assuan_simple_write,
+ NULL, NULL };
assuan_error_t err;
assuan_context_t ctx;
- int fd;
+ assuan_fd_t fd;
struct sockaddr_un srvr_addr;
size_t len;
const char *s;
@@ -109,7 +106,7 @@ assuan_socket_connect_ext (assuan_context_t *r_ctx,
/* We require that the name starts with a slash, so that we
eventually can reuse this function for other socket types. To
- make things easier we allow an optional dirver prefix. */
+ make things easier we allow an optional driver prefix. */
s = name;
if (*s && s[1] == ':')
s += 2;
@@ -126,7 +123,7 @@ assuan_socket_connect_ext (assuan_context_t *r_ctx,
ctx->finish_handler = do_finish;
fd = _assuan_sock_new (PF_LOCAL, SOCK_STREAM, 0);
- if (fd == -1)
+ if (fd == ASSUAN_INVALID_FD)
{
_assuan_log_printf ("can't create socket: %s\n", strerror (errno));
_assuan_release_context (ctx);
@@ -139,8 +136,7 @@ assuan_socket_connect_ext (assuan_context_t *r_ctx,
srvr_addr.sun_path[sizeof (srvr_addr.sun_path) - 1] = 0;
len = SUN_LEN (&srvr_addr);
-
- if (_assuan_sock_connect (fd, (struct sockaddr *) &srvr_addr, len) == -1)
+ if ( _assuan_sock_connect (fd, (struct sockaddr *) &srvr_addr, len) == -1 )
{
_assuan_log_printf ("can't connect to `%s': %s\n",
name, strerror (errno));