+ int type = SOCK_STREAM;
+#ifdef HAVE_SOCK_CLOEXEC
+ type |= SOCK_CLOEXEC;
+#endif
+ s = socket(PF_UNIX, type, 0);
+ if (s < 0)
+ return log_error("socket");
+
+#if !defined(HAVE_SOCK_CLOEXEC) && defined(HAVE_FD_CLOEXEC)
+ int fdflags = fcntl(s, F_GETFD);
+ if (fdflags != -1) {
+ fdflags |= FD_CLOEXEC;
+ fcntl(s, F_SETFD, fdflags);
+ }
+#endif
+