better error messages
This commit is contained in:
parent
9e4627500f
commit
835c1e4786
1 changed files with 5 additions and 1 deletions
|
|
@ -17,6 +17,7 @@
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
|
||||||
#undef unix
|
#undef unix
|
||||||
|
#define unix xunix
|
||||||
|
|
||||||
int
|
int
|
||||||
p9dial(char *addr, char *local, char *dummy2, int *dummy3)
|
p9dial(char *addr, char *local, char *dummy2, int *dummy3)
|
||||||
|
|
@ -122,9 +123,12 @@ Unix:
|
||||||
}
|
}
|
||||||
strcpy(su.sun_path, unix);
|
strcpy(su.sun_path, unix);
|
||||||
free(buf);
|
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;
|
return -1;
|
||||||
|
}
|
||||||
if(connect(s, (struct sockaddr*)&su, sizeof su) < 0){
|
if(connect(s, (struct sockaddr*)&su, sizeof su) < 0){
|
||||||
|
werrstr("connect %s: %r", su.sun_path);
|
||||||
close(s);
|
close(s);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue