if (errno == EPROTOTYPE) {
if (errno == EPROTOTYPE || errno == ECONNREFUSED) {
int trySocket() {	int s;	struct sockaddr_un addr; 		s = socket(AF_LOCAL, SOCK_DGRAM, 0);	if (s<0)	  return 1;   	bzero(&addr,sizeof(addr));	addr.sun_family = AF_LOCAL;	strncpy(addr.sun_path,_PATH_LOG,sizeof(addr.sun_path)-1);	if (connect(s,(struct sockaddr *) &addr,sizeof(addr))<0) {		if (errno == EPROTOTYPE) {			DDEBUG("connect failed (EPROTOTYPE), trying stream\n");			close(s);			s = socket(AF_LOCAL, SOCK_STREAM, 0);			if (connect(s,(struct sockaddr *) &addr, sizeof(addr)) < 0) {				DDEBUG("connect failed: %s\n",strerror(errno));				close(s);				return 1;			} 			close(s);			return 0;		}		close(s);		DDEBUG("connect failed: %s\n",strerror(errno));		return 1;	} else {		close(s);		return 0;	}}