unix socket without error messages...

origin
steffen 7 years ago
parent 1acdca5dad
commit 37be3de810

@ -117,13 +117,11 @@ int UNIX::Connect(string filename) {
addr.sun_family = AF_UNIX;
strncpy (addr.sun_path, filename.c_str(), sizeof (addr.sun_path));
if ((sock = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
printf ("socket: error:%s\n", strerror(errno));
return 0;
}
if (connect(sock,(struct sockaddr *) &addr, sizeof (addr)) == -1) {
printf ("connect: error:%s\n", strerror(errno));
close (sock);
sock = 0;
sock = -1;
return 0;
}
return 1;

Loading…
Cancel
Save