Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Revert "All supported OS have to support SOCK_SEQPACKET"
Baptiste Daroussin committed 10 years ago
commit dc04b1760390c572801987ab5bca9867598f5248
parent acc9766
2 files changed +18 -1
modified configure.ac
@@ -243,6 +243,19 @@ AC_SUBST([GIT_HEAD])
AC_DEFINE_UNQUOTED([GIT_HEAD], $GIT_HEAD)
AC_DEFINE([PKG_API], [api_ver])

+
AC_RUN_IFELSE(
+
  [AC_LANG_SOURCE(
+
    [[
+
    #include <sys/types.h>
+
    #include <sys/socket.h>
+
    int main() { return socket(AF_LOCAL, SOCK_SEQPACKET, 0) == -1 ? -1 : 0; }
+
    ]]
+
  )],
+
  [AC_DEFINE([HAVE_SEQPACKET], 1, [Define to 1 if you have SOCK_SEQPACKET working])]
+
)
+

+
AC_SUBST([HAVE_SEQPACKET])
+

AC_SEARCH_LIBS([lzma_version_string], [lzma], [], [
  AC_MSG_ERROR([unable to find the liblzma])
])
modified libpkg/pkg_repo_create.c
@@ -683,8 +683,12 @@ pkg_create_repo(char *path, const char *output_dir, bool filelist,
		if (--remain_jobs == 0) {
			/* Create new worker */
			int ofl;
+
			int st = SOCK_DGRAM;

-
			if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, cur_pipe) == -1) {
+
#ifdef HAVE_SEQPACKET
+
			st = SOCK_SEQPACKET;
+
#endif
+
			if (socketpair(AF_UNIX, st, 0, cur_pipe) == -1) {
				pkg_emit_errno("pkg_create_repo", "pipe");
				retcode = EPKG_FATAL;
				goto cleanup;