summaryrefslogtreecommitdiff
path: root/src/core/net-nonblock.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-07-16 20:18:05 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-07-16 20:18:05 +0000
commitc2397475c5105dc6d5db1fac0ee1d8f33b77b237 (patch)
tree0076cdb290a2c15627812f94c117d6c4d621ea85 /src/core/net-nonblock.c
parent2a1052bbcef9318e42df9a87cc4cfb9fe8ef5a40 (diff)
downloadirssi-c2397475c5105dc6d5db1fac0ee1d8f33b77b237.zip
Cleaned up code.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@480 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/net-nonblock.c')
-rw-r--r--src/core/net-nonblock.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/core/net-nonblock.c b/src/core/net-nonblock.c
index 86d0f263..d8e85b0a 100644
--- a/src/core/net-nonblock.c
+++ b/src/core/net-nonblock.c
@@ -25,8 +25,7 @@
#include "pidwait.h"
#include "net-nonblock.h"
-typedef struct
-{
+typedef struct {
NET_CALLBACK func;
void *data;
@@ -34,8 +33,7 @@ typedef struct
int port;
IPADDR *my_ip;
int tag;
-}
-SIMPLE_THREAD_REC;
+} SIMPLE_THREAD_REC;
/* nonblocking gethostbyname(), ip (IPADDR) + error (int, 0 = not error) is
written to pipe when found PID of the resolver child is returned */
@@ -56,7 +54,8 @@ int net_gethostbyname_nonblock(const char *addr, int pipe)
if (pid != 0) {
/* failed! */
- g_warning("net_connect_thread(): fork() failed! Using blocking resolving");
+ g_warning("net_connect_thread(): fork() failed! "
+ "Using blocking resolving");
}
/* child */
@@ -186,7 +185,8 @@ static void simple_readpipe(SIMPLE_THREAD_REC *rec, int pipe)
}
/* Connect to server, call func when finished */
-int net_connect_nonblock(const char *server, int port, const IPADDR *my_ip, NET_CALLBACK func, void *data)
+int net_connect_nonblock(const char *server, int port, const IPADDR *my_ip,
+ NET_CALLBACK func, void *data)
{
SIMPLE_THREAD_REC *rec;
int fd[2];
@@ -212,7 +212,8 @@ int net_connect_nonblock(const char *server, int port, const IPADDR *my_ip, NET_
rec->data = data;
rec->pipes[0] = fd[0];
rec->pipes[1] = fd[1];
- rec->tag = g_input_add(fd[0], G_INPUT_READ, (GInputFunction) simple_readpipe, rec);
+ rec->tag = g_input_add(fd[0], G_INPUT_READ,
+ (GInputFunction) simple_readpipe, rec);
return 1;
}