comparison dbutil.c @ 547:cf376c696dfc agent-client

Make it compile, update for changes in channel structure.
author Matt Johnston <matt@ucc.asn.au>
date Wed, 01 Jul 2009 04:53:17 +0000
parents d588e3ea557a
children 61c3513825b0
comparison
equal deleted inserted replaced
546:568638be7203 547:cf376c696dfc
293 293
294 TRACE(("leave dropbear_listen: success, %d socks bound", nsock)) 294 TRACE(("leave dropbear_listen: success, %d socks bound", nsock))
295 return nsock; 295 return nsock;
296 } 296 }
297 297
298 /* Connect to a given unix socket. The socket is not non-blocking */ 298 /* Connect to a given unix socket. The socket is blocking */
299 #ifdef ENABLE_CONNECT_UNIX 299 #ifdef ENABLE_CONNECT_UNIX
300 int connect_unix(const char* addr) 300 int connect_unix(const char* addr) {
301 {
302 struct sockaddr_un egdsock; 301 struct sockaddr_un egdsock;
303 int fd = -1; 302 int fd = -1;
304 303
305 memset((void*)&egdsock, 0x0, sizeof(egdsock)); 304 memset((void*)&egdsock, 0x0, sizeof(egdsock));
306 egdsock.sun_family = AF_UNIX; 305 egdsock.sun_family = AF_UNIX;
307 strlcpy(egdsock.sun_path, addr, sizeof(egdsock.sun_path)); 306 strlcpy(egdsock.sun_path, addr, sizeof(egdsock.sun_path));
308
309 fd = socket(PF_UNIX, SOCK_STREAM, 0); 307 fd = socket(PF_UNIX, SOCK_STREAM, 0);
310
311 return fd; 308 return fd;
312 } 309 }
313 #endif 310 #endif
314 311
315 /* Connect via TCP to a host. Connection will try ipv4 or ipv6, will 312 /* Connect via TCP to a host. Connection will try ipv4 or ipv6, will