Merge branch 'Polynomal-C/procps-master'

References:
 procps-ng/procps!47
This commit is contained in:
Craig Small 2017-12-29 15:57:43 +11:00
commit cde5cf5bab
3 changed files with 21 additions and 1 deletions

View File

@ -215,6 +215,10 @@ if WITH_SYSTEMD
proc_libprocps_la_LIBADD += @SYSTEMD_LIBS@ proc_libprocps_la_LIBADD += @SYSTEMD_LIBS@
endif endif
if WITH_ELOGIND
proc_libprocps_la_LIBADD += @ELOGIND_LIBS@
endif
proc_libprocps_la_LDFLAGS = \ proc_libprocps_la_LDFLAGS = \
-version-info $(LIBprocps_CURRENT):$(LIBprocps_REVISION):$(LIBprocps_AGE) \ -version-info $(LIBprocps_CURRENT):$(LIBprocps_REVISION):$(LIBprocps_AGE) \
-no-undefined \ -no-undefined \

View File

@ -178,6 +178,19 @@ AS_IF([test "x$with_systemd" != "xno"], [
]) ])
AM_CONDITIONAL([WITH_SYSTEMD], [test x$with_systemd != xno]) AM_CONDITIONAL([WITH_SYSTEMD], [test x$with_systemd != xno])
AC_ARG_WITH([elogind],
[AS_HELP_STRING([--with-elogind], [enable elogind support])],
[], [with_elogind=no]
)
# Do not allow elogind if systemd is wanted and found
AS_IF([test "x$with_systemd" != "xno"], [with_elogind=no])
AS_IF([test "x$with_elogind" != "xno"], [
PKG_CHECK_MODULES([ELOGIND], [libelogind])
AC_DEFINE(WITH_ELOGIND, 1, [enable elogind support])
])
AM_CONDITIONAL([WITH_ELOGIND], [test x$with_elogind != xno])
# AC_ARG_ENABLEs # AC_ARG_ENABLEs
AC_ARG_ENABLE([pidof], AC_ARG_ENABLE([pidof],
AS_HELP_STRING([--disable-pidof], [do not build pidof]), AS_HELP_STRING([--disable-pidof], [do not build pidof]),

View File

@ -40,6 +40,9 @@
#ifdef WITH_SYSTEMD #ifdef WITH_SYSTEMD
#include <systemd/sd-login.h> #include <systemd/sd-login.h>
#endif #endif
#ifdef WITH_ELOGIND
#include <elogind/sd-login.h>
#endif
// sometimes it's easier to do this manually, w/o gcc helping // sometimes it's easier to do this manually, w/o gcc helping
#ifdef PROF #ifdef PROF
@ -518,7 +521,7 @@ static void ns2proc(const char *directory, proc_t *restrict p) {
} }
static void sd2proc(proc_t *restrict p) { static void sd2proc(proc_t *restrict p) {
#ifdef WITH_SYSTEMD #if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)
char buf[64]; char buf[64];
uid_t uid; uid_t uid;