mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-27 11:52:03 +00:00
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>
|
||||
|
||||
#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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue