summaryrefslogtreecommitdiff
path: root/xmpp.c
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp.c')
-rw-r--r--xmpp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xmpp.c b/xmpp.c
index c718df4..18bb6c5 100644
--- a/xmpp.c
+++ b/xmpp.c
@@ -161,10 +161,12 @@ int xmpp_connect(void)
{
printf("net_init()\n");
+ int sock = -1;
+
char *jid;
char *pwd;
if (!get_credentials(&jid, &pwd)) {
- return -1;
+ return sock;
}
printf("Trying to connect as '%s' with '%s'.\n", jid, pwd);
@@ -173,7 +175,7 @@ int xmpp_connect(void)
struct addrinfo *addr = resolve_dns(domain);
- int sock = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol);
+ sock = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol);
if (sock == -1) {
printf("Failed to get socket from OS!.");
return sock;