From 8eb7eb97dc84e6d67bed93abf140bac431769864 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Posp=C3=AD=C5=A1il?= Date: Fri, 20 Jan 2006 10:03:05 +0000 Subject: [PATCH] test if connection to lbproxy is already open --- org.glite.lb.client/src/connection.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/org.glite.lb.client/src/connection.c b/org.glite.lb.client/src/connection.c index bbd03ee..c681527 100644 --- a/org.glite.lb.client/src/connection.c +++ b/org.glite.lb.client/src/connection.c @@ -204,10 +204,12 @@ int edg_wll_open_proxy(edg_wll_Context ctx) int flags; - ctx->connProxy->conn.sock = socket(PF_UNIX, SOCK_STREAM, 0); - if (ctx->connProxy->conn.sock < 0) { - edg_wll_SetError(ctx, errno, "socket() error"); - goto err; + if (!(ctx->connProxy->conn.sock == -1)) { + ctx->connProxy->conn.sock = socket(PF_UNIX, SOCK_STREAM, 0); + if (ctx->connProxy->conn.sock < 0) { + edg_wll_SetError(ctx, errno, "socket() error"); + goto err; + } } memset(&saddr, 0, sizeof(saddr)); -- 1.8.2.3