summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c4aafe0)
inet_ntop has a weird error return protocol. And our code for calling
it never worked properly because we didn't strip the leading directory
names from the bound socket name.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
char *comma=strchr(str,',');
if (!comma) { errno=ESRCH; return -1; }
*comma++=0;
char *comma=strchr(str,',');
if (!comma) { errno=ESRCH; return -1; }
*comma++=0;
- if (inet_pton(af,str,iav)) return -1;
+ int r=inet_pton(af,str,iav);
+//fprintf(stderr,"inet_pton(%d,\"%s\",)=%d\n",af,str,r);
+ if (r<0) return -1;
+ if (r==0) { errno=ENOTTY; return -1; }
// (unsigned long)sunlen);
errno=EDOM; return -1;
}
// (unsigned long)sunlen);
errno=EDOM; return -1;
}
- if (str2addrport(sun.sun_path,addr,addrlen)) return -1;
+ char *slash=strrchr(sun.sun_path,'/');
+ if (str2addrport(slash ? slash+1 : sun.sun_path,
+ addr,addrlen)) return -1;