+ struct sockaddr_un *un;
+
+ if((sk->family == AF_UNIX) && !sockgetlocalname(sk, (struct sockaddr **)&un, NULL) && (un->sun_family == PF_UNIX))
+ {
+ if(strchr(un->sun_path, '/'))
+ {
+ if(unlink(un->sun_path))
+ flog(LOG_WARNING, "could not unlink UNIX socket %s: %s", un->sun_path, strerror(errno));
+ }
+ }