plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

commit 835c1e4786bf14ca8a6b17d8538f8881f55ae764
parent 9e4627500fe3626ccfc01e2f1e3214162d0e54ec
Author: rsc <devnull@localhost>
Date:   Wed, 13 Jul 2005 03:55:44 +0000

better error messages

Diffstat:
Msrc/lib9/dial.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/lib9/dial.c b/src/lib9/dial.c @@ -17,6 +17,7 @@ #include <netdb.h> #undef unix +#define unix xunix int p9dial(char *addr, char *local, char *dummy2, int *dummy3) @@ -122,9 +123,12 @@ Unix: } strcpy(su.sun_path, unix); free(buf); - if((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) + if((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0){ + werrstr("socket: %r"); return -1; + } if(connect(s, (struct sockaddr*)&su, sizeof su) < 0){ + werrstr("connect %s: %r", su.sun_path); close(s); return -1; }