From 4d3acdef7b830d9b0f7eea2baeea567199ed5333 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 15 May 2015 09:14:52 +0200 Subject: [PATCH] lxdm: portability patches from Alpine. --- srcpkgs/lxdm/patches/execinfo.patch | 47 +++++++++++++++++++++ srcpkgs/lxdm/patches/fix-msghdr-usage.patch | 39 +++++++++++++++++ srcpkgs/lxdm/template | 2 +- 3 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/lxdm/patches/execinfo.patch create mode 100644 srcpkgs/lxdm/patches/fix-msghdr-usage.patch diff --git a/srcpkgs/lxdm/patches/execinfo.patch b/srcpkgs/lxdm/patches/execinfo.patch new file mode 100644 index 00000000000..521a04188e8 --- /dev/null +++ b/srcpkgs/lxdm/patches/execinfo.patch @@ -0,0 +1,47 @@ +--- configure.ac 2011-11-16 22:27:33.624019150 +0100 ++++ configure.ac 2011-11-16 22:29:49.537310486 +0100 +@@ -23,7 +23,7 @@ + + # Checks for header files. + AC_PATH_X +-AC_CHECK_HEADERS([shadow.h stdlib.h string.h unistd.h utmpx.h]) ++AC_CHECK_HEADERS([shadow.h stdlib.h string.h unistd.h utmpx.h, execinfo.h]) + + # Checks for typedefs, structures, and compiler characteristics. + AC_TYPE_PID_T +--- src/lxdm.c 2011-11-16 22:27:33.617019240 +0100 ++++ src/lxdm.c 2011-11-16 22:29:19.030694008 +0100 +@@ -52,7 +52,9 @@ + #include + #include + ++#ifdef HAVE_EXECINFO_H + #include ++#endif + + #ifdef HAVE_UTMPX_H + #include +@@ -1576,6 +1578,7 @@ + return success;; + } + ++#ifdef HAVE_EXECINFO_H + static void log_sigsegv(void) + { + void *array[40]; +@@ -1591,12 +1594,15 @@ + + free(bt_strs); + } ++#endif + + static void sigsegv_handler(int sig) + { + switch(sig){ + case SIGSEGV: ++#ifdef HAVE_EXECINFO_H + log_sigsegv(); ++#endif + lxdm_quit_self(0); + break; + default: diff --git a/srcpkgs/lxdm/patches/fix-msghdr-usage.patch b/srcpkgs/lxdm/patches/fix-msghdr-usage.patch new file mode 100644 index 00000000000..ec53327058e --- /dev/null +++ b/srcpkgs/lxdm/patches/fix-msghdr-usage.patch @@ -0,0 +1,39 @@ +--- src/lxcom.c 2013-10-04 10:40:08.000000000 -0300 ++++ src/lxcom.c 2014-07-18 11:21:22.734631159 -0300 +@@ -116,12 +116,20 @@ + char buf[4096]; + char ctrl[/*CMSG_SPACE(sizeof(LXDM_CRED))*/1024]; + struct sockaddr_un peer; +- struct iovec v={buf,sizeof(buf)}; +- struct msghdr h={&peer,sizeof(peer),&v,1,ctrl,sizeof(ctrl),0}; + struct cmsghdr *cmptr; + int ret; + +- while(1) ++ while (1) + { ++ struct iovec v={buf,sizeof(buf)}; ++ struct msghdr h={ ++ .msg_name = &peer, ++ .msg_namelen = sizeof(peer), ++ .msg_iov = &v, ++ .msg_iovlen = 1, ++ .msg_control = ctrl, ++ .msg_controllen = sizeof(ctrl) ++ }; ++ + peer.sun_family=0; + ret=recvmsg(self_server_fd,&h,0); + +@@ -315,7 +323,10 @@ + static ssize_t lxcom_write(int s,const void *buf,size_t count) + { + struct iovec iov[1] ={{(void*)buf,count,}}; +- struct msghdr msg = { 0, 0, iov, 1, 0, 0, 0 }; ++ struct msghdr msg = { ++ .msg_iov = iov, ++ .msg_iovlen = 1 ++ }; + #if !defined(linux) && !defined(__NetBSD__) + + #if defined(__sun) diff --git a/srcpkgs/lxdm/template b/srcpkgs/lxdm/template index 25e4a350f88..dbe49b55e1d 100644 --- a/srcpkgs/lxdm/template +++ b/srcpkgs/lxdm/template @@ -1,7 +1,7 @@ # Template file for 'lxdm' pkgname=lxdm version=0.5.1 -revision=1 +revision=2 build_style=gnu-configure build_options="systemd" configure_args="$(vopt_if systemd --disable-consolekit --enable-consolekit) --with-pam"