aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-07-13 03:55:44 +0000
committerrsc <devnull@localhost>2005-07-13 03:55:44 +0000
commit835c1e4786bf14ca8a6b17d8538f8881f55ae764 (patch)
tree500277c7e7ecaef94ef497cd34c6a07136f3cda7 /src
parent9e4627500fe3626ccfc01e2f1e3214162d0e54ec (diff)
downloadplan9port-835c1e4786bf14ca8a6b17d8538f8881f55ae764.tar.gz
plan9port-835c1e4786bf14ca8a6b17d8538f8881f55ae764.tar.bz2
plan9port-835c1e4786bf14ca8a6b17d8538f8881f55ae764.zip
better error messages
Diffstat (limited to 'src')
-rw-r--r--src/lib9/dial.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib9/dial.c b/src/lib9/dial.c
index 5b4ece07..c3634766 100644
--- 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;
}